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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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.

1
vote
1answer
19 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; ...
-1
votes
2answers
32 views

How to get color from texture at specific location in libgdx?

This is the screenshot of my game. This is a 2d platformer game where the player jumps to many differently colored tiles. On the left-hand top corner, there is a square tile which changes its color ...
0
votes
1answer
14 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
0answers
27 views

I want to create a basic 3d game engine in Java, Where should I start? [closed]

I've made a 2d game engine in python before, for a month long game challenge, but now I want to create a basic 3d game engine in Java. I figured Java would be a decent language for the task as I don't ...
0
votes
1answer
51 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
39 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 ...
1
vote
1answer
18 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
36 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
71 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
13 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
25 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
47 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 ...
-1
votes
0answers
38 views

Game tick system for web based 2d multiplayer sandbox game. Good approach?

For educational purposes, I'm trying to develop a game ticking system for a web based 2d multiplayer sand box game. I've never done something similar, but I'm experienced in developing enterprise ...
0
votes
1answer
28 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
51 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
1answer
21 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
59 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
31 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
35 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
24 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
19 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
43 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 ...
0
votes
1answer
37 views

JFrame pack() method

I'm quite new to java. I was developing a game using java and I realized that the position of pack() method can influence rendering. For instance: Frame Class ...
1
vote
1answer
24 views

How to insert animation into table?

I'm having trouble inserting animation into my libGDX table cell. I have a class which holds 2 tables, one on the left and one on the right. First table is for labels/buttons/other stuff. Second table ...
0
votes
1answer
86 views

How to sleep for the desired duration between game loop iterations?

My game loop below doesn't sleep as log as it should. The delta value always ends up less than 1, when it's supposed to be 16.6666 or close to 16.6666 ...
0
votes
2answers
236 views

Why does my Window take a few clicks to actually close even though the event fires?

I am pretty new to game dev (and libgdx + scene2d specifically), I am creating a dialog system for an rpg game and obviously a dialog window has a close button to close a dialog but for some reason it ...
1
vote
1answer
36 views

Why are clicks not corresponding correctly to XY positions?

I'm trying to make custom buttons in LibGDX (I really only wanted to use it for the Android/Desktop portability, not for any of its features, like Scene2D) The issue I'm having is that the clickable ...
0
votes
0answers
23 views

Slick2D - Shaders and Antialiasing

I'm looking for a way to smooth anti-alias my game, especially while using scale and translate operations. While translating my images are tearing, regardless of image filter. I tried to : change ...
1
vote
1answer
54 views

How to create a split screen display with one frame and canvas

I am creating a 2D Java game, which looks like this: My question is what should I do to my display to create two 'separate' displays. I plan on doubling the height of the program, and have a second ...
0
votes
1answer
27 views

Graphics2D.drawImage not working

I'm quite new to java. I'm trying to come up with my own game after watching a few video tutorials. However, I encountered a problem where I cannot draw an external image file that I loaded using the ...
3
votes
1answer
163 views

Java Game Loop Efficiency

I'm quite new to java. I was watching 2 video tutorials on how to make java game and read a couple articles about game loop. However, I'm still confused about how game loop actually works. The ...
0
votes
0answers
55 views

Use ARCore to detect marker and show information

I'm new to AR, and am trying to use Google's ARCore to build a simple AR prototype. Basically if a logo is detected, I like to place some real-time charts or text information on the screen. Similar to ...
0
votes
0answers
30 views

Libgdx i18nbundle work only root bundle

English isn't my first language. In mobile i18nbundle get only root bundle (BlueStacks similarly). Code : ...
0
votes
0answers
21 views

Smooth out animation that has a decimal as a speed modifier

My program is a simple arcade style game that uses a d-pad to move the player around the screen. At first the speed modifier was an int which didn't make the animation jittery across the screen, ...
0
votes
1answer
59 views

Rendering an isometric tilemap

I have a tile which is 512x256 pixels and I'm trying to render it in an isometric fashion. I have this helper function: ...
1
vote
1answer
71 views

I don't understand code that builds 3D sphere

I'm trying to learn some lwjgl and opengl, and I was trying to make a 3d sphere etc, I found a code to do that, but I don't 100% understand the code and the math behind it and would like to get some ...
0
votes
0answers
12 views

Java Question about setLayout(null);

I'm new to the programming world and would like to learn from experienced teachers. How would I be able to add a picture to a JFrame and at the same time be able to add a panel So I could add buttons ...
1
vote
2answers
27 views

Why do actors stretch when I add them to a stage in LibGDX?

I have started learning LibGDX and I have been making a few little games to learn how it all works but ever since I started using stages and actors, all of my textures stretch horizontally and I can't ...
0
votes
0answers
31 views

How is game account information stored so that multiple people can access it?

I'm new to game developing, and I hope to learn from the experts in this community. My question is about how multiple account information is stored, and how can I make it. My guess is that account ...
1
vote
0answers
17 views

Render imgui on top of existing Java framework

I have never done this before, but we need to build game editor, on top of our existing java game SDK. We want to use java version of imgui. I can easily create imgui window and put UI into it, but ...
-2
votes
2answers
101 views

Move ball based on player angle

I am trying to program a simple football game for practice purposes. I am trying to kick the ball forward based on the players position he came from. I found this question about moving a ball by ...
1
vote
0answers
73 views

LibGDX TileMap problem

my LibGDX map find olny two Layers but the map.tmx file contains more than two layers. Where is the problem? ...
1
vote
0answers
23 views

OpenAL listener position for isometric camera

I have an isometric camera for an RTS that looks like this: Basically, I don't know how to set the listener's position in OpenAL because I represent the camera's position with only two coordinates. ...
1
vote
0answers
58 views

Exception when opening new libgdx project in intellij

I'm trying to learn Libgdx and I used the project creator to create a project with the default settings. I then try to open the build.gradle in the root of the project and I keep getting an exception. ...
0
votes
1answer
132 views

Does Minecraft Really Rely on CPU More Than GPU For FPS? [closed]

I understand that Minecraft runs on Java which is very demanding on the CPU (garbage collection and JVM processes), but I still don't understand how FPS is the CPU's responsibility. Shouldn't the CPU ...
0
votes
1answer
37 views

Java: Updating entities in composite design

I'm trying to move beyond inheritance based design, but I've been doing it like that for 6 years. My current hurdle is this: What's the simplest( or proper) way to update all my objects? Before, ...
2
votes
1answer
91 views

Does abstraction influence performance?

Say I have a GameObject class that is being extended by all of the objects in the game that are moving around. (This class provides basic stuff like a sprite, draw ...
0
votes
0answers
23 views

Collision resolution sticks instead of allowing sliding along an edge

My current collision resolution code gives a sticky feeling: ...
1
vote
1answer
88 views

libGDX 3D rendering

I'm currently working on a FPS 3D game using libGDX. I aim to have maze-like levels (like the original Doom and Duke Nukem 3D) so I'm making a level editor with a top-down view and lets you stretch ...
0
votes
2answers
34 views

libgdx strange collision detection behaviour

I am currently developing a small Spaceshooter Clone. The project can be found on github I am having problems with my very simple collision detection (or better said some behaviour that I can't ...