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

learn more… | top users | synonyms

1
vote
1answer
52 views

How to poll input for a gui in libgdx?

Ok, so my question is simple. How do you poll input with a GUI class without it affecting what's underneath the GUI? So suppose you have an RPG game with a gui for the d-pad and other controls: ...
0
votes
1answer
69 views

Why doesn't my animation stop when I press a key?

I wrote a program that animates two squares diagonally across the screen, from opposite sides. Used Timer object to do so. The squares collide with each other and also with the frame boundary to ...
0
votes
1answer
54 views

libgdx: Rotate sprite on 3d plane

Im trying to create a game on a 3d plane but with 2d objects. I have a perspective camera and the ground plane drawn. I can't seem to get sprites onto it. I am trying to render the sprites, then to ...
0
votes
0answers
71 views

Moving objects smoothly, bad perfomance

I just finished developing my mini-game on Android and I got some questions about perfomance and generally "how to": If I have 25+ objects on the creeen (just a polygon with 7-8 angles) its starts to ...
0
votes
1answer
70 views

Getting the Ray position from View and Projection Matrix

I'm having some trouble calculating the direction and position of the ray from my matrices. I have tried some things such as: private Vec3 getPick(Mat4 projection, Mat4 view) { Mat4 ...
0
votes
2answers
59 views

How to get all points within a box?

What is the fastest way to get all of the points within a bounding box? If I had an ArrayList<Point>, and they weren't mapped to coordinates, would I have to loop through every point to see if ...
0
votes
1answer
62 views

How to clear out a drawn texture from the screen in libGDX

I am trying to clear out the drawn texture from the screen. Lets take a classic game example - in many games when the character goes through the coins the coins clears out from the screen and ...
0
votes
0answers
32 views

2D Collision in JavaFX - Bad accuracy with .intersects()

I have several Shape objects - Circle, Rectangle and Polygon. I use the built-in .intersects(Bounds1, Bounds2) method to detect collision but it's quite inaccurate. Circle c1 = new Circle(20); ...
0
votes
0answers
64 views

LibGDX vs Flash/Starling

I currently use Flash/Starling to develop cross platorm games. I love it because it has awesome features like tweens, texture atlases, DragonBones, touch gestures, ad integration, in app purchase ...
1
vote
1answer
68 views

How to use LWJGL Vertex Buffer Objects?

I have been learning how to make a game with LWJGL for a while now by following YouTube tutorials online but I've recently been having a problem understanding Vertex Buffer Objects. I've looked at ...
0
votes
0answers
25 views

Box2dLights rendering in bigger scale

So basically my box2dLights are rendering in wreid places. The circle in center is my player and as you can see lamp which should be aligned to player is in the right-top corner. my code: package ...
2
votes
1answer
127 views

3D Camera Rotation

Please, forgive me, but I need help and I've been stuck on this for a few weeks now, I'm making no progress and everywhere I go and I see a different answer, everything I try doesn't work. I've had ...
3
votes
1answer
169 views

Is it possible to implement Steamworks functionality in a Java game? How?

I have a basic game that I want to eventually turn into something better. The game is all Java as of right now, but I want to implement the Steamworks SDK into my game (so it can have achievements, ...
-1
votes
0answers
38 views

infinite parallax libgdx

I need help with my Parallax Libgdx, he manages to make the scroll, but not getting any way to repeat it infinite. public void render() { ParallaxLayer layer2 = null; float a = 0; ...
1
vote
0answers
56 views

3D Camera Y-Axis wrong angle

I am trying to build a camera class, though I am running into a problem. When I move the camera above/below, and try to move towards the ground, I am moved off in what seems to be about 45 degrees in ...
0
votes
0answers
16 views

Artificial physics : ball angle bouncing (Vector2) [duplicate]

My question is : how can I manage to move my object (ball) on a trajectory , and onContact with another object, it bounces, respecting the angle
2
votes
2answers
108 views

How to draw a rectangle or curve between two co-ordinates in libGDX

I am new to libGDX.I just want a Rectangle or a small curve drawn between the object and the clicked position .I know libGDX has RECTANGLE class. I just want to draw a rectangle or a curved line to ...
1
vote
1answer
32 views

How to match user click and the sprite object position in libGDX framework

I am using libGDX Java framework for developing a practice game in Eclipse. My game is in landscape mode and I am using sprite image for game assets. Actually I am trying to follow the Kilobolt ...
0
votes
0answers
126 views

How do I handle collision involving many characters?

My collision checking works fine. The problem is what to do after two zombies collide so they still walk towards the player but don't go through each other. My current method works fine for two or ...
0
votes
1answer
39 views

Concurrent touches not being detected

I have pretty much the same controls on the race example of the engine. A AnalogOnScreenControl and a button defined by a Sprite. The problem is, when I'm using the analog directional, touching the ...
-4
votes
2answers
49 views

Java Animating using drawImage

Hi I have a tile based game and I would like to know how to animate the grass image this is what I have so far: public class dirt extends block{ float frame = 0; public dirt(int x,int y){ ...
0
votes
1answer
125 views

How do I handle collision response between many different types of game objects?

I am looking for a way to avoid the dreaded switch or if/else scenarios between numerous game object types when a collision takes place in a game. For example: You have a list of game objects which ...
1
vote
1answer
191 views

Java : 2D Sidescroller Terrain [closed]

Okay so After all this Edits here is the main question. How I can generate Terrain with a 2d Simplex Noise Algorithm, I am deletng old info so the post its more readble. I´ve been doing some tests and ...
0
votes
0answers
33 views

Why isn't my texture changing after calling display list?

I can't bind another texture after calling glCallList. It does nothing. However if I change texture inside the list, it works.
0
votes
1answer
60 views

Distorted LookAt When Looking Up or Down?

I have a weird problem and I have no idea what's going on with it. Recently started doing some OpenGL programming, going pretty well, hit some rough spots but worked my way through them and otherwise ...
1
vote
1answer
95 views

Best mobile games resolution ratio

What is the best landscape and portrait resolution ratios that will fit the most of the devices out there and the black bars size will be minimum?
1
vote
1answer
54 views

Java JscrollPane [closed]

Hello I have a game where you can have a shop and buy stuff. when you press enter the shop stock menu opens. I want to be able to show all of the items available and I want to be able to scroll threw ...
0
votes
0answers
30 views

libgdx get rotated sprite coords points

I would like to get the position of each edge of a sprite when he has been rotated. I have no idea how to do it, I made a image to explain it. I would like to get the X and Y position of each Red ...
3
votes
1answer
142 views

What is wrong with my smooth shading code?

I am having trouble getting smooth lighting to work in Java Monkey Engine. My terrain is voxel-based, with an iso-surface generated via Marching Cubes over the data field. Up until now, I have been ...
-1
votes
0answers
31 views

Map in Scene2d/LigGdx

I'm a little lost for my game. For the moment I've a car, who work, but now I want to create a map (like hill Climb Racing for example, not necesserly randomly generated). I don't know how to do ...
0
votes
1answer
59 views

How to blend bullet sprite from white to yellow in libgdx

Does anyone have a clue that will make my bullet sprite fade from yellow to white? As the bullet is created it will be white but when it trails on it will turn yellow. Any ideas how? Is it a simple ...
1
vote
0answers
46 views

Astar optimalization (A*) [closed]

So I have written own implementation of AStar (A*) algorithm to find paths around my 2d tile based map. My problem is that if I call it each frame (I need to do it) and I'm searching path from corner ...
4
votes
1answer
167 views

Are display lists faster than VBOs?

I'm making a voxel rendering engine. My "chunks" are 32 * 32 * 256 blocks and I can render a 16 * 16 square of them (which corresponds to Minecraft's maximal render distance). I'm using VBOs holding ...
1
vote
0answers
81 views

Android and OpenGL, single thread vs double thread

I'm trying to optimize my Android OpenGL ES 2.0 application, and I find myself being CPU bound. After googling, I've found this, which suggest to use a thread for updating objects, and a thread for ...
2
votes
1answer
246 views

Maintaining velocity of free fall body using Box2D in libGDX

I want to maintain the speed of a free-falling Box2D body using LibGDX. I'd like the vertical velocity increase with the level. I've applied a linear impulse and velocity actually increases like this: ...
1
vote
0answers
52 views

Cannot distinguish depth in an isometric cube

I am having a problem with distinguishing different depths in my new 'game.' It is a game similar to Minecraft, only it is rendering in isometric format. The problem is, I cannot think of a way to ...
0
votes
0answers
53 views

Finding the correct transformation in vertex shader for easy sprite drawing

Before we begin the question: Here are the necessary meta information: I want to use JOGL / OpenGL to create a library that is only, and I repeat only, able to draw and manipulate 2D sprites on a 2D ...
1
vote
2answers
36 views

(LibGDX) Changing Origin of Box2D World relative to TiledMap (or Vice Versa)

I'm playing around with Box2D and TiledMaps and I've come across this minor annoyance. As you can see, both Box2D and TiledMap render at the center of the screen. This forces me to compensate by ...
1
vote
2answers
65 views

How do I inline images between text in a Table?

I have a Table and a Label with wrapped text. I want to display some images in-line with the text. For example: This is an image -IMAGE_HERE-, and now some more text showing, yet, another image ...
1
vote
0answers
16 views

Java how to add sound to an application [closed]

Hello I would like to know how to add sound to an application I have viewed a video on utube but it only works on an applet and other ones need extra libraries. I don't know how to approach this at ...
1
vote
1answer
92 views

Swing for game development - regarding threads

For those of you who use Swing to develop their real-time Java games. (Meanign a game that constantly updates game state and redraws the screen using a constant loop). As I see it, there are three ...
1
vote
1answer
90 views

Game Update in Libgdx

In libgdx, the game loop is the render() method. But why is that, and is there a way where I can make an update() method that is called 60 times a second? As in the update() method, I would add the ...
0
votes
1answer
27 views

Slick2D: Animation not being parsed from spritesheet correctly

I have a 960x960 spritesheet with each tile being 192x192. I initialized my spritesheet and animation like so: spritesheet = new SpriteSheet("resources/spritesheets/player.png", 192, 192); ...
0
votes
2answers
60 views

Artillery Simulation [duplicate]

I need some help on a simulation of an Artillery like this one https://www.youtube.com/watch?v=YktWSKo_UbA. I cant figure out how to make the "tomato" to get to the selected spot. Where can I get ...
0
votes
1answer
112 views

Top-down player collision with walls

I am having trouble trying to think of how I am going to approach collisions in my game. My idea which sucked in the beginning because it would reduce performance dramatically has failed which was ...
0
votes
2answers
112 views

How do I merge quads to simplify a heightmap?

I'm trying to improve my frame rates. My map has an area of 200 * 200 vertices, where each vertex has a height. 200 * 200 = 40000 vertices per frame. I'd like to create a method to simplify the ...
0
votes
1answer
127 views

Java 2D World question

I have a 2D world background made up of a Grid of graphics, which I display on screen with a viewport (800x600) and it all works. My question is I have the following code to convert the mouse ...
1
vote
1answer
96 views

Pixel Perfect collision detection on rotated bitmaps [duplicate]

I have two bitmaps which are being drawn onto a canvas using a matrix canvas.drawBitmap(bitmap, matrix, paint); first to work out if I need to check for a collision i am using eucilidean vectors ...
1
vote
0answers
143 views

How do I implement a “sliding out of / into” effect on a settings menu similar to that in Angry Birds?

I'm trying to implement a settings menu component similar to that in Angry Birds - a button control that makes an options menu slide out of it and back into it when clicked on. I use scene2d.ui to ...
0
votes
1answer
92 views

Should I use tiles in a snake game? [closed]

I'm building a simple snake game, which is my first game ever. I'm using LibGDX, which is Java-based. I've looked at the Tiled Map Editor, but I don't know if it is necessary in a simple game like ...