A game library which enables cross-platform game development in Java, with support for Android development and desktop development. It makes use of OpenGL for portability.

learn more… | top users | synonyms

0
votes
0answers
1 views

Dialog bar with LibGDX: Scrollpane won't' scroll to bottom after adding stuff to the contained table

To my game I want to add a gui element that displays text and textButtons whenever something is happening or it wants you to make a decission (an answer while talking to a person for example). To keep ...
1
vote
2answers
109 views

Are shaders the only way to implement 2d lighting?

I'm working on a 2d top down game with libgdx and I think i got the basics. No want I want to implement lighting, I don't know anything about lighting. I want just to have some light sources and ...
0
votes
0answers
30 views

Pausing an animation in Libgdx

How would I pause an Animation from the LibGdx animation class? I've followed tutorials that teach me how to animate a sprite sheet but none to pause it. I'm trying to make an animation play once ...
0
votes
0answers
28 views

I'm getting an ArrayIndexOutOfBounds Exception and I don't know why. Can someone shed some light? [on hold]

This is my first time making a 2D game. The code is in Java. I have a character that can shoot blasts at zombies, and this is how I have been dealing with the collision detection between the blasts ...
0
votes
0answers
29 views

Libgdx: different speed on different devices

I am running a simple Libgdx app that I have wrote, on my Android phone and Android tablet and I am getting the unexpected result of having different velocities when a body is moved. To move the body ...
0
votes
0answers
18 views

Libgdx Tiledmap OrthographicTileMapRenderer Issue [on hold]

I've tried to load my Tilemap in TMX-Format created with Tiled in my libgdx android project. It worked but when i scrolling with the camera i often see the background color instead of the background ...
0
votes
0answers
29 views

Using Blender to define physics objects for libGDX

I'm in the early stages of building a game using libGDX. The game is 3D and will use Bullet physics (gdx-bullet wrapper). I have a 3D scene loaded and have manually created some physics objects which ...
-1
votes
0answers
27 views

Can't figure out why my sprite isn't moving

In my libGDX game I'm trying to make it so that the player character moves left and right depending on which side of the screen you press. However, when I run my code, I keep getting a null pointer ...
0
votes
0answers
37 views

How can I split my entity manager class into a gameworld class and gamerenderer class?

I currently have a libGDX game where I have an entity manager class which is called in the gamescreen. Instead, I would like to utilise it in a gameworld class and a gamerenderer class, but I cannot ...
0
votes
0answers
28 views

Partitioning a Tiled map

In my 2d platformer with libGdx, my maps are quite large (eg. 200x200). The player character is only 2 tiles high. I use Box2d for collision, so in my tiled map I have layers for terrain, ...
-1
votes
1answer
49 views

How can I implement input handling into my game?

I'm making a libgdx game where the player dodges falling objects. To move the player I have it set so that on desktop he moves left and right when you press A and D respectively. I am trying to ...
0
votes
0answers
22 views

Sprite collision Rectangles LibGDX

I have a big problem with my sprite top collision. Here ismy constructor public CoolGuy(){ full = new Rectangle(0, 0, 50, 98); bottom = new Rectangle(0, 0, 50, 15); top = new Rectangle(0, ...
0
votes
2answers
84 views

Basic 2d platform collision detection algorithm has a slight bug (Java)

I'm trying to implement collision detection between Player (the main character) and a Platform. They are both modelled as rectangles; when player hits the side of a platform he should bounce off it ...
2
votes
1answer
41 views

Box2D Lights - Simulate water

I have a libGDX project, in which I have a Box2D world, which is currently filled with some boxes as a terrain. I also added a DirectionalLight to the scene for simulating the Sun. I almost have the ...
0
votes
0answers
11 views

Cannot instantiate the type BodyEditorLoader

Hello I'm trying to use BodyEditorLoader in my game BodyEditorLoader loader = new BodyEditorLoader(Gdx.files.internal("data/test.json")); But I get this error Cannot instantiate the type ...
0
votes
0answers
45 views

I have an array of blasts and an array of zombies, how can I efficiently detect collisions? [duplicate]

I have an array of blasts, and an array of zombies, but I'm struggling to find a way to efficiently detect collisions and remove both the blasts and zombies that have collided. Any suggestions? ...
0
votes
0answers
10 views

(LibGDX) Changing Color of Actor

So, I have a class that extends Actor, and I'm trying to change the alpha value of it; objectPreview is a type of that class: @Override public void display() { ... // remove previous object ...
0
votes
1answer
24 views

How can I render a simple lattice in LibGDX?

I have searched all over, but I can't find what I think will be a simple answer. I am using Opengl ES 2.0, and LibGDX. I simply want to use GL_LINES primitives to create a lattice structure. I have ...
0
votes
0answers
29 views

Is there a way to capture back button twice in same activity libgdx game

Can anybody tell me if there is a possibility to capture back button twice in same activity in libgdx. What i want to achieve is that if the user press back button once the game pause. if in the ...
0
votes
1answer
39 views

Animation fails due to a NullPointerException which I'm certain shouldn't be thrown (LibGDX / Java)

What the title says basically. I've been stuck on this error for a few hours I got it to work earlier but I honestly can't see why its failing now (ctrl + z'd back to the working stage). Here's my ...
0
votes
1answer
48 views

Update Loop in libGDX

I have a screen class in libGDX. In this screen, I want to change a sprite's texture a certain number of times before the screen changes to a different screen class. I tried having a for loop in the ...
-2
votes
1answer
36 views

How can I format the number of digits my stopwatch shows? [closed]

I have made a stopwatch that displays the time in seconds during my game in libgdx. At the moment it shows a bunch of digits after the decimal point as it runs. Does anyone know how to change it so it ...
1
vote
0answers
54 views

LibGDX scene2d good practices

I'm developing a game using LibGDX and in a part it has a pretty complex UI for profile selection and stuff. I have some general problems. I'd like to know good practices when generate good looking ...
1
vote
1answer
31 views

Semi-transparent mouse cursor on Windows

I want to change the mouse cursor for a desktop game I am writing with libGDX. That is working well under Linux, however, under Windows semi-transparent cursor pixels are not being rendered at all. ...
0
votes
0answers
20 views

Issue about different screen resolutions

for me it Looks like that my 3D human and my 3D platform don't get touched by different resolutions and different aspect ratios. For debug purposes i added a font which Shows the actual FPS and a ...
0
votes
0answers
58 views

drift/skid in topdown racer with libgdx/java [duplicate]

I'm trying to do a simple top-down racing game and is struggeling to get the steering right. At the moment I'm using a very simple steering and want to add some drifting to the car. I've read some ...
0
votes
1answer
30 views

LibGDX - Executing 2 different touchDown events in the same method

On the bottom left of my screen is a circle with an Arrow and on the bottom right is a circle with a gun. If the player is in jetpack mode and the Arrow "button" is clicked he flies like flappy bird ...
1
vote
0answers
19 views

box2dlights confuses ScreenUtils for screenshots in libGDX

I take screenshots as usual in libGDX via ScreenUtils.getFrameBufferPixmap(), which works fine. Hoever, when I call RayHandler.updateAndRender() during rendering, then the screenshot only contains ...
0
votes
1answer
30 views

switch between player camera/non-camera positioning

Sorry if this sounds ambiguous. But I am writing a traditional top down game. And normally the player would be centered in the middle while moving the orthographic camera. However, I would like this ...
1
vote
1answer
44 views

How can I adjust my code to make the objects start dropping at a certain speed and then increase that speed over time?

I'm making a game in LibGDX where the player dodges falling objects. At the moment, my code makes each object (in this case 'DROPS') fall at random speeds. I'm wondering if anyone can suggest how to ...
0
votes
0answers
16 views

LibGDX with GWT ignore source file changes

I'm using LibGDX with GWT to create a web version of an app that runs without problems on the desktop, Android and iOS. However, the HTML version of the app had a few problems with constructs ...
0
votes
0answers
21 views

libGDX TextureRegion drawing weird when scaled

Having a weird issue. I have a Texture with four frames of a sprite Animation. Each frame is loaded as a TextureRegion. Most of the time the Animation play without any issues, but occasionally it ...
0
votes
1answer
76 views

Libgdx Box2D and Screen Viewport Scaling

I am currently having problems getting an easy to manage system of scaling my units for use with box2D. Normally I would create virtual units to go along with me viewport and camera but since I am ...
0
votes
1answer
67 views

Libgdx Hud with two stages

I have an app that's currently working with a single stage but i need to add a side display/section as a HUD, with scores/lives etc on it, so that the HUD is on the left, and the main hand screen on ...
1
vote
0answers
24 views

Is there a way to rotate an Ellipse in libGDX for collision detection purposes?

I'm trying to avoid having multiple overlapping Circles for a UFO-shaped sprite. Two Ellipse objects will perfectly cover the shape of my UFO, but I want to tilt/rotate the UFO when flying left and ...
0
votes
0answers
21 views

How will i know if the Body is facing a the target angle [duplicate]

I want to know if the body of the car is facing the line on the picture
-1
votes
0answers
12 views

Need suggestions about dealing with different screen sizes on android [duplicate]

I always wandered how can one make a game for different screen sizes. I'm guessing that you can use different sized images, but there are large amount of screen resolutions and making pictures for all ...
0
votes
1answer
30 views

Libgdx Sprite is not drawn when generated inside another class

I´ve built a gameloop where I generate new items depending on the elapsed time and want to place them somewhere on the screen. I use some randomness for the color and coordinates. For better design I ...
0
votes
0answers
17 views

libGDX SpriteBatch.draw() origin not working as expected

I'm having a weird issue with SpriteBatch.draw(). I'm using the Ashley Super Jumper demo (https://github.com/siondream/ashley-superjumper) as the basis for my code. Here's the render queue: ...
0
votes
1answer
22 views

Clearing a libGDX pixmap

Is there a way to clear a libGDX Pixmap? Or is the only way to dispose it and create a brand new Pixmap?
0
votes
0answers
27 views

Bullet Collision Shape doesn't wrap Model correctly

i got an object called human and an object called platform. I simply let the human fall down on the platform with a constant speed. No acceleration! The problem is that my collision shapes for both ...
1
vote
1answer
79 views

Implimenting BADLAND like Body Movement in Box2d

I am trying to make a body (character in my game) move and behave in the same way as the character in the BADLAND Game with regards to rotation. The character does not have fixed rotation and behaves ...
0
votes
1answer
21 views

Valid instances not drawn

i have a problem with my code, my valid instances aren't drawn. I'm just at the beginning so i will post the whole code(which sounds bigger than it is)..just a few lines public class MyGame ...
0
votes
1answer
29 views

How do I draw an object that I always want to appear in the same place on screen on a scrolling orthographic camera using lib gdx?

So I want to make an endless scroller game and the orthographinc camera is scrolling downward so i want the character to stay with the camera. I'm not sure how to aproach this i've been looking a lot ...
0
votes
0answers
16 views

invisible actor at group (libgdx)

I add to HorizontalGroup several actors: 1, 2, 3. I want to set invisible 2nd actor, and it doesn't take any space (seems in Android View.GONE - ...
0
votes
0answers
30 views

how to detect collision with libgdx and tiledmap [duplicate]

As you see , it's a picture from my game map , i have to create a 2d rpg game when a character can do many things. Currently i'm looking for a solution to handle collision between the character and ...
0
votes
1answer
42 views

libgdx - Box2d debug draw not correct

I have a problem where the bodies in my debug draw does not draw correctly, take a look: As you can see, there is some space between the dynamic body and the ground. I have checked the contact ...
0
votes
0answers
8 views

Loading flipped atlas in libgdx using assetmanager

i'm trying to load a TextureAtlas with the AssetManager but i can't find a way to flip it upside/down. Without using the asset manager, this is possible by using the standard constructor of the ...
0
votes
0answers
36 views

Libgdx triangulation messing up triangles

I'm trying to triangulate a convex polygon. On the left are the triangulated polygons, while on the right is the convex polygon without triangulation. (both are wrong) but the one on the right is ...
0
votes
1answer
71 views

Smooth transitions between 2d animations

I am writing a 2d game (in libGDX, but I think that doesn't matter too much). In that game I want to have smooth transitions between animations. For example, let's think of a guy walking around. Now ...