Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Java is both a popular object-oriented programming language and runtime environment which allows Java programs to run unchanged on most hardware and software platforms.

0
votes
0answers
12 views

multiple mouse events for splitted screen on Libgdx

well i am working in a fps game , and i also splitted the screen in two parts for two players , i am using the mouseMoved event for the camera,, but in this situation literally i need two cameras each ...
0
votes
0answers
17 views

Does oracle have plans to replace javafx? [on hold]

I have already learned swing, and I am thinking about switching to javafx. Will javafx likely be replaced in the future or will it stay around for a long time?
0
votes
1answer
80 views

Use a different language for engine and game

Just a quick question that I haven't been able to find an answer to, I am creating an engine for a game, I have begin making the engine in C++ but I want to make the game in java. My question is, is ...
1
vote
1answer
110 views

How to allow to slide rectangle to not colliding with corners between two rectagles?

I am detecting each side of collision between two rectangles, and wen I collide them, lets say, with the left side, it also detects collision on the top side when I move to the top, and the downside ...
0
votes
0answers
12 views

libgdx button doesn't work everytime

I made a button, which stops my game. The is a menu, where you can continue the game. But if the cam moves with the player, the button doesn't work anymore. You can see it, but if you click on it ...
-2
votes
1answer
40 views

Making a Java Swing game a browser based game [closed]

I have made a game in Java using Swing for the GUI. It is a network game relying on the client-server model. Basically the game is a turned-based chess-like game. It has a connection menu, game ...
0
votes
1answer
32 views

LibGDX - Animate Player using Finite State Machine in Ashley ECS

Hi everyone this is my first question on this forum hope you can clarify my doubt. I'm gonna start by saying that im not very good at english so my apologies. So I have a big school project and I'm ...
0
votes
0answers
5 views

IllegalStateException while rendering font via slick-util TrueTypeFont

I tried to load a font via Font awtFont = new Font("Times New Roman", Font.BOLD, 24); TrueTypeFont font = new TrueTypeFont(awtFont, true); and then call ...
0
votes
1answer
41 views

How to create an even gamescore?

Currently I'm doing an android game. My problem is the score. The game speeds up in every round and currently I'm counting the score like this: ...
-1
votes
1answer
29 views

trying to work out coords based collision [closed]

In this game I'm working on, both player and enemies are represented by 32x32 sprites(not using bounding boxes). I'm trying to make a system where if the x and y coordinates of the player and ...
0
votes
1answer
33 views

Correctly drag object with mouse

I already have a MouseMotionListener with the mouseDragged method implemented. I can drag an object with the mouse, but it doesn'...
1
vote
1answer
83 views

My Java Game's movement looks awfull. Maybe Problem with Thread.sleep

I have a big problem with my Java games. In every game I make the movement of the player and objects just looks awfull. The framerate is 60 fps without any problems. But the movement looks extremly ...
0
votes
2answers
82 views
0
votes
1answer
48 views

Billboard quad in same draw call?

I am currently drawing a isometric world in 3D, meaning the floors and walls are all quads aligned to the original axis in the world and using a rotated orthogonal camera to "distort" the images into ...
0
votes
0answers
46 views

How can I use the NDK to make games?

I want to use NDK to use my existing C++ code for a game. I know there are two ways to use NDK: I can use Java to create GLSurface and opengl context; I can use NativeActivity class to entirely write ...
0
votes
1answer
23 views

Cannot find folder when building game to .jar LibGDX

Whenever I run my game from my IntelIJ IDEA the game runs fine. It finds every folder and every asset in there. But whenever I build my game with :desktop:dist and ...
0
votes
0answers
30 views

how to combine, intersect or subtract shapes? [duplicate]

is there a way to intersect, combine or subtract multiple shapes together similar to java.awt.geom.Area in LIBGDX or any libraries similar to this that will work on any device?
0
votes
0answers
19 views

Developing RCON for Squad

I have found in the internet Java RCON Library - https://github.com/Kronos666/rkon-core, but then I entered IP, port and password and asked server to send available commands - server didn't respond. I ...
0
votes
0answers
29 views

libgdx - can't drag/click on Dialog

I'm having problem with Dialog. I have Dialog (let's say MainDialog) with button. After the button is clicked, another Dialog pops up. Everything is fine, but I can't drag nor click the buttons from ...
0
votes
0answers
40 views

How can I fix this MineCraft Forge OpenGl error?

I am making a MineCraft Forge 1.12 gun mod. The gun works but I only need to add some animations for reload and aim. So I have tried something but I gives me an error every time. ...
0
votes
1answer
34 views

How can I speed up the shapes drawing on high-density devices?

I have a game that should draw many shapes on the canvas and in every frame these shapes position will change, the game is running smooth but after adding more shapes some jerk arise and it drops some ...
2
votes
2answers
30 views

How can I efficiently change the color of a BufferedImage?

I am trying to change the color of a white BufferedImage image. I do know that you can use .setRGB(x,y,rgb) and simply run some ...
0
votes
1answer
17 views

libgdx - getButtonTable() missing Window method

I'm following some tutorial to create my own Inventory for my game. I have met with an insidious problem: ...
0
votes
1answer
30 views

libgdx - creating static HUD/widgets on screen

I'm having problems with creating static HUD/buttons on the game screen. Currently my game has a character moving on the tiled map, with OrthographicCamera put on, everything works fine. I wanted to ...
0
votes
1answer
44 views

libgdx - how to make enemies not overlap

I'm currently making a roguelike shooter in libgdx to get a better understanding of the library but I recently just stumped onto a problem where enemies would overlap each other while tracking the ...
0
votes
0answers
85 views

Java Game is slowing down

Every time I start the game it works fine but after a second everything starts to slow down almost exponentially and i am currently not able to find my mistake. Here is the main code: ...
0
votes
1answer
7 views

InputListener not working on a custom Actor

Right now I am working on a UI for my game. I'm adding my own UI elements to a group and adding that to a stage. But the listeners I'm adding to the actors are not firing off at all. I have looked on ...
0
votes
1answer
14 views

moving object while being snapped to another one lwjgl

hi now I want to move an object(cube) while being snapped to the surface of another one (sphere) with the same surface of the cube how can i achieve this in lwjgl here is a diagram. to describe my ...
-6
votes
1answer
87 views

I don't know what's wrong with the code

I am making a 2D game in java but it doesn't draw anything on the srceen and I don't know why. I have files(Main.java -> JFrame, Game.java -> GameLoop). Code: Main.java: ...
0
votes
1answer
26 views

libgdx - Problem occurring after collision detected

I have just implemented collision detection in my little 2d rpg-like game. I'm using Tiled for the maps, mechanism is simple - I have one layer called 'collision' in my tiled map, and while loading ...
-1
votes
1answer
32 views

Java 2d array to generate grid - java.lang.ArrayIndexOutOfBoundsException: length=4; index=-1

I am creating a Hashi Puzzle game (Islands and Bridges) I am generating a 2d grid with Islands that can be connected using bridges, I am also running a DFS algorithm to check if the map is solvable I ...
1
vote
1answer
32 views

Move object at angle like a sine wave

I currently have this code, which moves an object in a straight line at an angle, where "dir" is the angle. velX = (float)(Math.cos(Math.toRadians(dir))) * speed; ...
0
votes
1answer
16 views

jMonkeyEngine ignores keyboard input

Created a game login form using the Nifty GUI. The interface reacts to the movement and clicking of the mouse, but ignores the input in the text fields. Whether the program is looking for a click ...
0
votes
1answer
70 views

How can i collide two bodies without filtering(collision filtering)?

I have two bodies with fixtures. One is platform or ground and other is the player itself.I want to collide the player to the platform without bit filtering.How can i do that?I can see the rectangular ...
0
votes
0answers
54 views

How to set attack-range of a weapon type in an Aion private server?

I am trying to develop an open source emulator for the server of the game Aion. In this emulator, attack ranges of the weapons differ from retail server. I have checked ...
0
votes
1answer
54 views

Drag and drop more than one sprite (image) on Libgdx

well i am trying to achieve the same effect of windows desktop , you can select multiple icons and drag all of them to differents positions. here you can see how i select the images in the second ...
0
votes
0answers
42 views

improving a real-time tile based 2d lighting system

I'm making a 2D game with lots of little particles that can fly all around the screen. The viewport has a resolution of 900x900px. Within that region, at most 450x450 particles can be displayed per ...
1
vote
2answers
86 views

How can I store my 2D map in JAVA?

I'm working on a 2d adventure game where the player can explore a random generated map. It's working perfectly if I set it to be about 3000x1000 blocks (my array is 3000x1000x2), but this is TOO SMALL....
0
votes
0answers
20 views

How to force LibGDX to screen resolution on Android?

No matter what type of viewport I use, the Android version of my code renders to exact resolution on the bottom left of the screen. How do I make it occupy the whole screen realestate? I've tried ...
1
vote
1answer
37 views

How to set a box2d body to follow a strict path

I'm making an infinite runner type game and I want one of my enemies (when it's created) to swoop down in a sort of U motion where it'll hit the player if they don't react quick enough once the enemy (...
1
vote
2answers
55 views

Implementing win condition

I'm making a turn based game in java for fun, it follows a set game flow pattern contained in a loop. I realized that once a player hits a win condition the game continues playing out the rest of the ...
0
votes
1answer
46 views

libGDX 3D texture is stretched

I'm working on a 3D maze game using libGDX. I'm using MeshBuilder to render the walls. All walls are a single part made using a ModelBuilder in the create(): ...
0
votes
1answer
56 views

Open world game state saving Android

As a hobby project I'm building a 2D game with a custom game engine in Android. Currently I can render a json map, and let the user interact with objects on the map. The game should be an open world ...
0
votes
2answers
51 views

Why is the Tilemap not fitting the screen?

I have a background image which I made it in tiled map editor of width 40tiles and height of 8tiles.When I run the game the tilemap bounces with the player and I can see the black portion of the ...
3
votes
2answers
85 views

How to make the camera follow the player in Libgdx?

In Play class I have the viewport of game height=320 and game width=240unitswith camera cam. I have set the camera(cam) viewport width to 10 and viewport height to 7.I have another camera hud whose ...
3
votes
1answer
35 views

Java/LibGDX Self made Input Field

I want to create an Inputfield from Scratch in Java and LibGDX, my Question is: How can I display only certain Parts of a String in a specific width? For example: My Input field GUI is 200 pixels ...
1
vote
1answer
48 views

Dragging arrow around using touch point Bubble Shooter libGDX?

So, now I've got into my second problem of implementing the arrow. The rotation works fine from this link but I have to calculate the angle from a touch point to the middle of the arrow placement. I'...
1
vote
1answer
38 views

Implement Bubble Shooter arrow rotation using LibGDX?

I'm trying to implement an arrow at the bottom of the screen on an Android device. This arrow is placed in the center of the screen and is supposed to rotate by a given angle. The problem is that when ...
0
votes
1answer
23 views

Libgdx Tiled | Using setTile results in a NullPointerException

So, I'm attempting to change the texture of a block when the player comes in contact with it by using cell.setTile(tileSet.getTile(926). I've already looked at ...
0
votes
1answer
80 views

Tuning physics for a “worms”-like game

I'm using LibGDX and Box2D for my physics but my characters bounce all over the place when moving and if there is a small slope in the terrain they launch off of it. I've tried tweaking settings but ...