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
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
21 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
30 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
35 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
46 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
54 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
41 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
79 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
40 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
25 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
45 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
24 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
50 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
25 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
119 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
105 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
30 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
0
votes
1answer
39 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
20 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
25 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
30 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
86 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
32 views

Valid instances not drawn [on hold]

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
35 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
26 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
36 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
55 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
17 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
41 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
92 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 ...
0
votes
0answers
19 views

Libgdx ParticleEffect world position

I want the particle effect to follow an object in the world, but since the particleEffect uses viewport positioning the desired effect is lost as soon as the camera starts following the object. the ...
0
votes
1answer
76 views

Trying to add a feature to my (basic) level parsing algorithm - not sure how to (JAVA)

Right now this method goes through a list of GameObjects (e.g. JetPack, Platform) with their respective x and y positions in a text file called level1.txt: platform 840 280 platform 1130 280 coin ...
0
votes
1answer
35 views

LibGdx Scalling sprites on Android

I have a sprite that is a few buttons but need them in the center of the screen for all android devices. I tried setting it's location to the center of the screen by dividing the orthogonal camera by ...
0
votes
1answer
51 views

Tiled PolygonObjects rendering wrong in libgdx

this is how I render the polygons in Tiled this is how they get rendered in libgdx. Notice the top part of the triangles is straight instead of being hollow. here is the code I use to convert the ...
0
votes
0answers
9 views

How to specify core project path in Libgdx Project Generator?

I am following a tutorial on making a flappy bird with the Libgdx framework. -http://www.kilobolt.com/day-11-supporting-iosandroid--splashscreen-menus-and-tweening.html I am currently on the step of ...
0
votes
1answer
87 views

Libgdx box2d crashing

im making a game in libgdx which i having a bunch of circle bodies floating around in space and when the player's body crashes into another body, that body deletes and creates two smaller bodies ...
0
votes
2answers
74 views

Why does this simple if-statement that checks my main characters state never get called (Java/LibGDX)?

Been working on this for a while - basically I want my player to perform a front flip when he jumps (screen tap -> player jumps). I wrote the animation class Animator (extends Player implements ...
0
votes
1answer
95 views

Draw a line/curve for the path an object has taken

Hello I am making a game in libgdx. I want to draw a line/curve of the path a object have taken. First a thought I could save all positions of the objects each iteration and draw line between them ...
0
votes
1answer
96 views

Java, Crashing with a Shader on Intel HD Graphics

I just got a new computer (Acer Aspire ES1-311) which has an integrated Intel HD Graphics card, and I noticed that this fisheye shader crashes my game (LibGDX game, VM Crash): varying vec2 ...
0
votes
2answers
58 views

Simple LibGDX Pong game drag player instead of getting x position

I got a working pong game in LibGDX but when I touch the screen the player x automaticly jumps to the coordinates I touched. I wan't my game to detect I touched and then move the player to the ...
0
votes
2answers
51 views

how to fix the character flip when using orthographic camer libgdx

i used orthographic camera to follow the character(player) but the problem that is my character is flipped there is no tutorials on how to fix this please help as fast as possible here is my create ...
1
vote
1answer
56 views

Why does this impulse not affect the body?

I'm just getting started with Box2d and I'm trying to apply an impulse to a circle but nothing really happens. First I define ball: BodyDef bodyDef = new BodyDef(); bodyDef.type = ...
0
votes
0answers
13 views

How to experiment for the value of gravity in Libgdx? [duplicate]

I am following a guide on how to play a flappy bird clone in the LibGdx framework. -http://www.kilobolt.com/day-5-the-flight-of-the-dead---adding-the-bird.html I am currently on the part where the ...
0
votes
1answer
59 views

Scene2d Stage Actor setup issues

I am creating a game using libgdx. In the same each level has a class. I have stage as a member variable of the class. To this stage, I add actors. Inside the levels class, I have attaced the input ...
0
votes
2answers
79 views

How do I derive an appropriate acceleration value for my game?

I am creating a Flappy Bird clone from this tutorial. I have a question about acceleration in libgdx. The author assigned the bird a constant acceleration vector in the constructor of the bird ...
2
votes
1answer
176 views

How to save file in assets so it can be properly loaded in Android Studio?

I am following a guide on creating a replica of Flappy Bird. - http://www.kilobolt.com/day-6-adding-graphics---welcome-to-the-necropolis.html The step I am having trouble is loading the texture from ...