LibGDX is a cross-platform Java game development framework based on OpenGL (ES) that works on Windows, Linux, Mac OS X, Android, iOS and your WebGL enabled browser.

learn more… | top users | synonyms

4
votes
1answer
130 views

On Android, How can I avoid FPS drops during sensor listener setup/tear down?

When I open my Android app after 5 or 10 seconds it sets up the sensor listener, during which I see clear stuttering and the FPS drops for a second to 40 instead of 60. Is there a way to avoid this? ...
0
votes
1answer
52 views

LibGDX: how to implement 2 cameras in a unique stage

I am quite new to LibGDX. I am trying to make a game, where the character is an Actor, and it's controlled by a Touchpad(included in the main Stage as an Actor too). My problem is that I am trying to ...
0
votes
1answer
62 views

How to apply Buoyant force to a Box2d body?

I have been following a formula to calculate the buoyant force needed to apply to a dynamic body to be able to simulate water. Fb = ρgV Fb - is the buoyant force ρ - density of the liquid g - ...
1
vote
0answers
33 views

Different Box2D bodies act differently and unexpectedly with same mass

I have a box2d body which is simply a rectangle (the spaceship). This ship flies around, affected by the gravity of planets (static circle bodies) just fine. I have tried changing the ship fixture ...
0
votes
1answer
145 views

Creating puzzle on libGDX

Good afternoon. Help me please to add the code for the game. This game is puzzle. Everything works good, but I would like to have not just ordinary puzzles with numbers, but also the puzzle with a ...
1
vote
0answers
13 views

Setting useImmersiveMode to true makes a moving sprite blink in a LibGDX game

I'm developing a simple game where i have gravity and a body which jumps when i touch the screen and a sprite displaying in its position. All is good until i set useImmersiveMode to true on ...
0
votes
1answer
23 views

How to change the way LibGDX scales images?

I'm using FillViewport and OrthographicCamera. LibGDX is scaling my images rather badly - jagged edges, visible pixels. How can I change the scaling method? by the way, I'm pretty sure the issue isn'...
0
votes
1answer
25 views

Libgdx change the image inside table dynamically

I am trying to draw a HUD that shows the score and time and image like loading but I want to update and change the image when the score get higher but I tried to do that but it is not working. I ...
1
vote
1answer
132 views

Collision with player following mouse

I'm making a RPG with libGDX. I've loaded a TiledMap and now I'm implementing the player movement. The view is top-down. In my game I want two ways of input: one is using the ARROW keys to move the ...
0
votes
0answers
24 views

Hills / Rounded Terrain Generation in libGDX

I'm trying to make a game that has rounded 2D terrain like hills, etc. Im familiar with creating and rendering 2D Rectangles using the ShapeRenderer, but i need some "Get Started"-Help on how to ...
1
vote
1answer
27 views

LIBGDX font.draw() makes letters blink on PC

I load Bitmapfont then try to draw it, but on PC(desktop) build screen blinks with frequecy that I can judge that backbuffer is not drawn. On Android all is fine, I don't see blinking. I simply do ...
1
vote
1answer
40 views

LibGDx android : Show animation on button click

I am trying to create an application using libgdx where i need an animation to be played on pressing an image button, i've been able to achieve it using this code if(slapBossFlag==true) { ...
0
votes
0answers
28 views

How does game engine in language A and game logic in language B work? [duplicate]

What I'm trying to understand. A lot of games, Like Crea by Siege games and Viking Squad by Slick Entertainment. Uses of course an graphics library/engine for there game but one language ...
0
votes
0answers
11 views

libgdx : starting animation disables imagebutton

I am playing an animation on clicking an imagebutton in android. Both the imagebutton and the Image for animation are actors on same stage. Animation plays perfectly, but the issue is after the ...
1
vote
0answers
7 views

Game freezing when i create a body Box2D Libgdx

I'm implementing a Worms game using libGDX and Box2D and I'm having a problem I didn't have until recently. When a player shoots, it creates a bullet body and applies a force to it. I have a step ...
0
votes
2answers
185 views

2D Platformer: add ability to jump on top of other character

I want to add ability to jump onto a head of other character/player, but still be able to go through them horizontally. There is one useful tutorial about one-way platforms, but that approach doesn't ...
36
votes
5answers
8k views

How can I give the illusion of height to a ball in 2D?

In 2D top down soccer games, sometimes a ball is given the illusion of being in the air, like below: How can I achieve this?
0
votes
0answers
7 views

Should I boost run task via disabling TexturePacker?

I decided to create textures with keeping in mind that the largest screen resolution that my game will be working with is 1920x1080. So, menu background texture in my game will be always 1920x1080. ...
0
votes
1answer
26 views

Sprite update issue

I'm currently implementing Box2D with LIBGdx and i'm having issue on update, as you can see on this video : https://www.youtube.com/watch?v=D3Nph6yftTQ whenever my player move or the camera move the ...
0
votes
0answers
32 views

Libgdx game doesn't work correctly after game over screen

So, I am trying to create a platform game for Android. As part of the game, I have created ladders that the hero is climbing. When he hits the enemy he dies, there is a game over screen --> touch to ...
0
votes
1answer
41 views

How to normalize angles from points in java

Previous thread on projectile slopes What is the velocity of a translating projectile in 2D? What I'm trying to do Get the slope at a constant speed for both X & Y Coordinates though I don't ...
1
vote
2answers
83 views

What is the velocity of a translating projectile in 2D?

What I'm trying to do. So I want to have a projectile that starts at point (x1, y1) and head in the direction of my mouse say point (x2, y2). To clarify I'm pretty sure it's a vector but I don't ...
0
votes
0answers
30 views

How can I make an animation in LibGDX?

In my game the player is running away from enemies and when he can't keep up the speed anymore I want the enemies to fade in from the side of the screen as the player is still running as show in this ...
4
votes
3answers
267 views

How to achieve sprite reflection effect in libgdx

I am currently working on an open world game similar to Pokemon using libgdx. I am currently stuck on this effect that I really want to be done before moving to other features of my game. How can I ...
1
vote
1answer
317 views

Sprites are rendered as black rectangles in android 4.0.x only

I have some problems rendering sprites correctly on a LG optimus vu (android version 4.0) with libgdx. Basically sprites are black rectangles, while other images that i declare as Texture are correct. ...
1
vote
0answers
240 views

error in post a screen shot of game scores with Android Intent in LIbgdx game [closed]

I want to post a screen shot of my game on social apps. I have developed this game using Libgdx framework. I have created an interface in Core class. Here is its Intent share specific code. ...
4
votes
1answer
81 views

Move Sprite in constant speed on squircle

I'm creating a game and i need to move a sprite on squircle path. https://en.wikipedia.org/wiki/Squircle i created the path using the equation : angle -= Gdx.graphics.getDeltaTime()*speed ; ...
0
votes
0answers
89 views

libgdx limit angular speed

I'm working on my top-down game. y characters use pathfinding + steering behaviors(Arrive and FollowPath) to move. I've implemented my character class from libgdx SteeringActor class (from tests). So ...
1
vote
1answer
127 views

How could I draw text in an 'info bubble' with libgdx?

I am making an android game using libgdx where there are textures on the screen which represent people. When you touch a person sprite I want a little info bubble to pop above their head displaying ...
0
votes
0answers
26 views

libgdx box2d move object in bezier curv

I'm making a game and i need to move my game object in a bezier curv path i succeeded in doing it: //create Bezir curv .... path.valueAt(outMove, val); path.derivativeAt(...
1
vote
1answer
2k views

Libgdx Do a fixed rotation for orthographic camera

I'm trying to rotate my OrthographicCamera in the render loop to a fixed angle, but I can only make the camera spin. This is the code that I have: in create(): OrthographicCamera camera = new ...
0
votes
0answers
25 views

libGDX GWT compile with “-style DETAILED”

So basicly my libgdx HTML5-gradle build doesn't work. When switching from state it gives the following error: __gwt$exception: <skipped>: Cannot read property 'tM' of null Of course I want to ...
0
votes
1answer
37 views

Random black screen when changing states

I'm making a game with LibGDX but I ran into a really odd problem. When I was working on the loading screen I delayed the loading process with an image of ~87MB. When the loading is finished, it ...
2
votes
5answers
333 views

How to make sure that when two bodies collide, there is only one collision detection on box2d?

I'm using LibGDX with Box2D and, when two bodies collide, the collision is detected multiple times. Here's the code: public void preSolve(Contact contact, Manifold oldManifold) { Body a = contact....
0
votes
0answers
17 views

Hotplugging LibGDX

Trying to find a work around to getting hotplugging to work with LibGDX (the latest version seems still like it doesn't support it). Anyone know of something I could do to get joystick hotplugging to ...
0
votes
1answer
28 views

LibGDX Rotate 2D image with touchDragged() event

Objective: to rotate an image in the center of the screen with movement equal to left or right touchDragged event. Right now I have a basic Stage that is created and adds an actor (centerMass.png) ...
0
votes
0answers
8 views

LibGDX Box2D Body shape transformation

In the following method my player Body is created: public static Body createPlayer (World world) { BodyDef bodyDef = new BodyDef(); bodyDef.type = BodyDef.BodyType.DynamicBody; ...
0
votes
0answers
23 views

Box2d Body filled with a texture Libgdx

I have a simple triangular shape (obstacle) in my game and i would like to fill it with a texture repeatedly. I have looked at the other 2 topics but couldn't find a working solution. How can i fill ...
0
votes
1answer
42 views

LIBGDX: Translate grid drawn with ShapeRenderer with an OrthographicCamera

I am trying to draw a grid for my "world" that may or may not extend beyond the screen. What I would like to do right now is draw the entire world (which is relatively small) and then use the ...
4
votes
1answer
190 views

OpenGL(Libgdx) - How to texture a 2D terrain surface?

I want to texture the surface of my terrain. I have created the ground mesh and surface mesh separately and everything is okay for ground mesh. But I couldn't texture the surface mesh correctly. As ...
0
votes
0answers
49 views

LibGDX works well on android 4 and very bad on android 5 and 6

I have a problem with my game. The game is made with libgdx, scene2d and box2d and it uses an AssetManager. I tested this app on all my devices and here it is the results: Galaxy S3, android 4 (...
0
votes
1answer
17 views

Scaling a single scalar using OrthographicCamera

I'm trying to convert a length (well, a radius) from world coordinates to screen coordinates using an OrthographicCamera. However, the only method I've figured out so far is to do a projection, with ...
1
vote
1answer
143 views

libgdx FollowPath proper usage

I'm developing top-down rpg game and got some problems using https://libgdx.badlogicgames.com/gdx-ai/docs/com/badlogic/gdx/ai/steer/behaviors/FollowPath.html I have a path (picture 1), in this case 2 ...
3
votes
1answer
94 views

Just how expensive is it to bind textures in OpenGL? (LibGDX)

I'm using LibGDX on top of OpenGL and currently my game engine does something along the lines of the following per frame Bind a terrain texture sprite atlas and a set of transparency masks in ...
0
votes
1answer
25 views

Color aura around object in libGDXs actor

my question is, if there is some easy mechanism to create color aura around actor in libGDX? Thanks for all tips
0
votes
2answers
107 views

A single libgdx gamescreen with pop-up menu, getting ready, hud and game over?

Is it possible and practical to have only one screen, like a GameScreen class, where the menu, getting ready (plus instructions), hud (only score) and game-over screens can pop-up when needed. Can I ...
8
votes
2answers
7k views

Repeat texture in libgdx

How to fill region with repeated texture? Now I'm using next method: spriteBatch.begin(); final int tWidth = texture.getWidth(); final int tHeight = texture.getHeight(); for (int i = 0; i < ...
4
votes
2answers
200 views

Poor performance wth custom particle system in LibGDX

I'm using a custom particle system for my LibGDX / Java based game project (because I used Slick2D earlier on, need more parameters so I made my own and then ported). The system is fairly standard as ...
1
vote
2answers
53 views

LibGDX Gravity and Jumping

I'm trying to implement gravity and the ability for the player to jump in my 2D LibGDX game. At the moment, I have two handlers: One for gravity and one for keyboard input @Override public boolean ...
0
votes
0answers
34 views

Blur shader decals

Im trying to implement custom shader for decal GroupStrategy in libgdx, and I'm having some noob GLSL and OpenGL problems. I have implemented shader looking at this: http://xissburg.com/faster-...