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
1answer
46 views

Animation reset in libgdx

i have an issue that i hope it's easy to resolve. I'm playing various animations in my libgdx-created game. For a particular animation, i need that to play in loop mode but only if a particular ...
1
vote
2answers
156 views

LibGdx - Move sprite in the direction of other sprite

I'm kind new to LibGdx and I'm still learning. I'm working on a small game project to learn this nice framework. However, I'm having some issues with my game. My game is a top down shooter. There is a ...
0
votes
0answers
25 views

Libgdx. Sprite won't stop moving;

I can't stop a sprite from moving. Here's my code: boolean moving; Gdx.input.setInputProcessor(new Input(){ public boolean touchDown(int screenX, int screenY, int pointer, int ...
1
vote
1answer
138 views

How do I make my main character move towards an object? LibGDX/Java

What I want to happen is for my player to bounce from spring to another. For example take the illustration below: Here's my code (what I've tried to do so far). This gets called in an ...
1
vote
1answer
102 views

LibGDX Box2D Lights - Illuminate background

I have a box2D world made of tiles. I use a custom DirectionalLight for light up the scene from above (It shines through transparent blocks [eg.: the water] more deeply). The problem is (as expected), ...
0
votes
0answers
20 views

Problem of textureRegions display after display two screens

I have a texture display problem, knowing that they display correctly in the desktop project and before packer textures. but once I packed textures, they still appear in the first screens((enuScreen ...
1
vote
0answers
134 views

Libgdx simple movement with velocity [closed]

Ok so this is driving me nuts. I've followed 3 tutorials now and I'm trying to get simple velocity to work and it just doesn't want to work for me. I have an open space and I want the character to be ...
1
vote
1answer
134 views

LibGDX Android Application only running once

I'm having trouble trying to figure out why my LibGDX game only runs successfully once on Android. Assuming the game has not been installed on the device, when I run the application from eclipse the ...
0
votes
0answers
95 views

Images not scaling properly in LibGDX when using “batch.setProjectionMatrix(camera.combined);”

I am trying to put Assets into my game but when i put in the line of code "batch.setProjectionMatrix(camera.combined);", which from my knowledge scales the Asset to the size of the window it appears ...
1
vote
1answer
52 views

LibGDX/Java - Trying to find the vector from one object to another

I want to add springs in my game that work like the ones in sonic - i.e. if you can't get over an obstacle you have to hit a spring which sends the main character flying towards another spring that ...
0
votes
0answers
32 views

Rendering dialog in libgdx.

Here's what I'm doing: public void create() { float w = Gdx.graphics.getWidth(); float h = Gdx.graphics.getHeight(); camera = new OrthographicCamera(); camera.setToOrtho(false, w, ...
0
votes
2answers
185 views

LibGDX - Best way of scrolling background

I'm new to LibGDX and i'm trying to implement a screen where i have a guy running and the ground under him scrolling to give impression he is really running in a sidewalk for example. The ground ...
-1
votes
1answer
50 views

Sprite movement only works the first time, can't figure out why [closed]

In my libGDX game I have finally managed to get the sprite to move the way I want him to but for some reason my desired outcome only works the first time I run the code. If I try to run it again, he ...
0
votes
1answer
81 views

LibGDX how to efficiently handle button presses

I'm making a simple 2D game for android using LibGDX. My game needs to have many buttons in it that fire off a method when pressed, and I was wondering what the best way to do this would be. I tried ...
0
votes
1answer
322 views

LibGDX: Scrollpane won't scroll to bottom after adding children to 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
246 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 ...
1
vote
2answers
112 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
94 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 ...
0
votes
1answer
113 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
36 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
79 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
62 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
277 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
181 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
26 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
63 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
49 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
90 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
107 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
71 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
59 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
1answer
161 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
59 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
36 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
122 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
32 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
32 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
65 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 ...
1
vote
0answers
18 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
46 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
652 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
194 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
54 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
22 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
0
votes
1answer
68 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
35 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
52 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?
1
vote
0answers
38 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 ...