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

0
votes
0answers
59 views

How to update projectile trajectory point?

I am a new game developer, I am making a game, but I have a problem, I don't know how I can update my trajectory point in OnDraw method. Could anyone please help me? Thank you! Here is my code: ...
1
vote
0answers
53 views

Libgdx stops all sounds when there are lots of sounds

I'm making a 2D game for Android using Android Studio with Libgdx in Java. I have a class, called SoundPlayer, which holds an ArrayMap. The key is the name of the sound file and the value is the sound ...
0
votes
1answer
20 views

InputProcessor without stage

I have a GameScreen where I'd like to have a pause button. I've tried using an Image with a listener, but since my GameScreen isn't a stage, I can't use that in the inputProcessor. So my question is ...
0
votes
0answers
30 views

TiledMap Safe Area for different screen resolutions

I'm creating a Tower Defense game using libGDX (w/ scene2d) and TiledMap. I've been reading extensively about viewports and how I can better manage various screen sizes. I want my Tiled Map to take ...
0
votes
1answer
46 views

Simplifying Object Factory

I'm making a game for Android using Libgdx with Android Studio in Java. In my game, I have a class called ObjectFactory which has a method createGameObject(int objectType) which receives an integer ...
5
votes
2answers
613 views

Main game objects as static

I'm making a game for Android using Android Studio with Libgdx in Java. In my game there are main object like Screen, ObjectFactory, SoundPlayer, Painter (Responsible for drawing) and a few more. 'til ...
0
votes
1answer
24 views

TiledMap renders but gets duplicated when I move the camera

I've created a map (TMX file) using Tiled, imported it and it shows great but when I move the camera, it duplicates itself and the whole screen flickers. In Tiled, I didn't use a spritesheet but ...
-1
votes
3answers
72 views

How to scale bitmap font without having it pixelated

How do i increase the size of a bitmap font without having it get pixelated, in libgdx?
0
votes
0answers
20 views

AdMob Banner appears 960x150 instead of 320x50 in libGdx - what's wrong here?

I am a bit helpless with this strange effect from AdMob. AdView is instanciated in code and so is the relative layout and libGdx view. View view = ...
0
votes
0answers
9 views

libgdx - objects are drawn elongated when width and height are the same value

I don't use view ports but my camera is set to the screen width and height of the device. My objects are drawn longer(taller?) then they should be. I check my sprites and they are square not ...
1
vote
0answers
35 views

Best way to create defence(withdraw) algorthim libgdx?

I have created user body and enemy body. Enemy body uses the steering behavior created by gdx AI. User body have it own control inputprocessor. World doesnt have gravity. Enemy body arrives the user ...
1
vote
1answer
40 views

Collision Detection Unresponsiveness

I'm creating a simple jumper game in Libgdx that makes the player jump over obstacles in order to stay alive. The only problem is that the collision detection for when the player just touches the ...
0
votes
1answer
32 views

LibGDX Textfield - Text Overflow - Not Wrapping

In my app's registration screen, the textfield is not wrapping text as I expected. Notice in the above image, the email field is not containing the text. I have set the size of the textfield using ...
0
votes
0answers
25 views

libgdx - Math reflection to the correct direction

I'm using a simple reflection system, but the game doesn't work how I want. How should this game work? The game has two boxes. A red side and a black side. The player should only sort the bombs to ...
0
votes
1answer
50 views

Switching Screens without initializing them every time

I have a UI with four Screens (all extending a "main Screen") that users switch between very frequently, at the moment I am switching Screens using g.setScreen(new screen);, but this leads to the ...
0
votes
1answer
39 views

Libgdx Sprite rotation around specific point

I made complex dynamic body that rotates around other body that is static. It works perfectly, however I got messed up with sprite position on that body. Here's what I have now and here's what I ...
0
votes
0answers
48 views

Why is my tiled map moving when I move the camera in libGDX?

I use LibGDX. I have created a map with Tiled Map Editor and loaded it to the game. Everything else is working well, but when I move the camera, the map moves: it jumps or floats. My code: public ...
0
votes
1answer
31 views

Libgdx shaperender within a circle as limitter

I encountered a problem, where my small entities would be rendered out of the bounds of my radar. At the time I solved it like this: ensure, that the object would be within the circle, but, that's ...
1
vote
0answers
37 views

Java Libgdx Attaching Sprite to Box2D Body

So I am working on programming a java 2D platformer for fun on the side and I have a rendered TMX level and a box2d body (just a circle shape) that I am currently using as my player. All the controls ...
0
votes
3answers
81 views

LibGDX - Trying to make a radar-like display

i have an interesting question about geometry. I have two or more moving objects outside of my stage's viewport (blue and red circle in the image below), which i want to point at with two arrows on ...
0
votes
0answers
39 views

LibGDX - black bars, FitViewport and drawing background

actually I'm creating game in LibGDX and i have few problems. I'm trying to solve resolution and aspect ratio problem by using FitViewport but i want to dispose black bars which occur when resolution ...
0
votes
1answer
105 views

libgdx - Math for wall collision when adding velocity

I've created a game which spawns a random colored ball in the top or bottom of the screen and moves to random direction with this method. private Vector2 position; private Vector2 velocity; private ...
0
votes
0answers
35 views

How can I simulate a basketball throw in LibGdx box2d?

So I want to simulate a similar throw like in the game Bouncy Basketball. Do i need to create a body and attach another body on it that would be the arm and then how would I apply force/impulse to the ...
1
vote
0answers
45 views

libGDX text doesn't appear in TextField

A game I'm working on has libgdx's TextField. They work fine in every instance I've used them, however on a play tester's phone he says no typed text appears in the box until enter or space is ...
0
votes
1answer
35 views

I can't center my actors with ExtendViewport, Libgdx

I'm making a level select screen and I need use ExtendViewPort (I can't use Fit for other reasons), but this viewport moves my actors to the left, I need center them. I put X and Y position ...
0
votes
1answer
39 views

What does the TextureRegion.flip() method do?

I'm learning libgdx and don't understand the purpose of parameters passed to flip(boolean x, boolean y). For example, I have code like this: texture = new ...
1
vote
1answer
77 views

libgdx - Texture not appearing sometimes

When I run the App the Ball moves sometimes downwards, but sometimes its not moving. I dont change anything on script. What I want is the ball should come from top outside of the screen, but when its ...
0
votes
1answer
70 views

Reskinning assets on-the-fly with LibGDX TextureAtlas

I'm building a game for Android using LibGDX and I'm attempting to add in a skin feature so players can change the look of the game on-the-fly. I've packed the skinnable assets into their own .pack ...
0
votes
0answers
26 views

Scene2D set table cell size in percentage of tables ´s size

Is it somehow possible to set Scene2D table cell´s size in percentage of the table? I would like to have orientation independent menu, with buttons filling let´s say 75% percent of the screen, and ...
0
votes
0answers
49 views

Box2D Physics Crazy

I have a simple Box2D Game with a dynamic player, a static floor, and a matrix of gems. The problem is that the physics engine goes crazy. You can see in this video: https://youtu.be/iaH_ex8eVVk ...
1
vote
1answer
40 views

How to rotate an image on touch using RotateToAction in libGDX?

I want to rotate my image on touch but it never applies action, I'm using RotateToAction to achieve this. class actorCark extends Actor { Texture texture; Sprite sprite; Global g; ...
0
votes
1answer
49 views

What type of networking system should I use With LibGDX on Android?

I've been looking for a good way to implement multiplayer in an Android strategy game I'm working on, using LibGDX. What I found: The embedded LibGDX networking system Kryonet Google Play Services ...
1
vote
1answer
38 views

Libgdx, actor touchlistener not working

public class Main extends ApplicationAdapter { SpriteBatch batch; OrthographicCamera camera; Stage stage; Image greyback; Image circle; private float width; private float height; @Override ...
0
votes
1answer
28 views

LibGDX: Transition scale bitmap font

I'm trying to create a Minecraft like quotes on the menu screen of my game. I'm using BitmapFont to draw the text on screen but i don't know how to make that scale up scale down effect. This is what ...
0
votes
2answers
41 views

Sprite not drawn on the same position as its Body LibGDX after implementing Pixels Per Meter Division on Box2D

I had a problem where the sprite was not positioned on Body correctly which I solved and you can see it here: Box2D is not positioned on the sprite correctly LibGDX After I solved that, I needed to ...
2
votes
3answers
128 views

Accelerated movement in a specific time to a specific point

I am trying to move my sprite in a specific time to a specific position while using frame-independent or time-dependent movement. My sprite is also accelerated every frame to simulate gravity. I know ...
1
vote
1answer
71 views

How to handle two players playing on one keyboard with Box2D (LibGDX)?

I'm making a racing game with LibGDX and Box2D. I've been using this tutorial to implement the basic physics, and it works properly. My main problem is to implement two different sets of keys ...
0
votes
2answers
49 views

Box2D is not positioned on the sprite correctly LibGDX

I have a strange issue where my Box2D is not being positioned on the player correctly. Down is the picture: What I find more strange is that the Box2D is positioned correctly on the cloud that is ...
0
votes
2answers
90 views

Why is my character passing through in Box2D?

I have a collision problem in Box2D. I am trying to do a simple platform game with Libgdx, Box2D and TiledMap. I have a map made with TiledMap: I load the map in my Android game. I read all the ...
0
votes
1answer
48 views

LibGDX--constant high score in top corner

I'm currently programming a game using LibGDX and box2D. I have a sprite (player) that moves up the screen, kind of like doodle jump. I'd like to have my camera to be centered around the player at ...
1
vote
1answer
54 views

Box2D fixed timestep updating is twitchy on constant FPS

I'm messing around with libgdx and box2d and I'm trying to implement sidescroller movement with fixed timestep logic according to the famous Fix Your Timestep! tutorial/guide. However, logic updating ...
2
votes
2answers
125 views

Box2DLights in libGDX - Bad quality of the light gradient on Android

I am facing a problem while porting one of my libGDX project from desktop to Android : My game uses Box2DLights. While the light effect look very fancy on the desktop version of the game, it looks ...
2
votes
1answer
79 views

LibGDX How do I create a Shop? [closed]

My game is fully working but now I want to make a shop so that the player can buy boosts or other useful stuff for the money the player has collected. What is the best way of doing this kind of ...
0
votes
1answer
25 views

LibGDX - Bundling Files

I have 3 files. A JSON file, a PNG file, and a TXT file. Is there any possible way I can put all three inside a common file with a custom extension? (for example "fileName.abc") I searched the web a ...
1
vote
0answers
116 views

Libgdx and gdx-ai: How to implement wander behavior?

So I follow the original gdx-ai documentation and created 2 circles to test Steering behavior. The image shows arrival behaviour but I am still quite lost about how they work. Screen class: public ...
-2
votes
1answer
25 views

What is the purpose of the second parameter to Array.removeValue in libgdx?

I have been wondering what the second parameter of the method in Array removeValue does. removeValue(T value, boolean identity) What does indentify mean and should I pass true or false?
0
votes
0answers
14 views

DragAndDrop release with pointer on payload

When I am moving my payload all the way to the corner it remains on the stage and my mouse goes over it when I then release (on a valid target) it returns null as a target and thus does not drop ...
1
vote
0answers
18 views

Behvior of Ninepatch when smaller then unstrechable area?

I create a healthbar from a Ninepatch background and "fill" texture. However, it starts overlapping it's patches when it gets very small. Is there anything I can do about this? Is there a way to ...
0
votes
0answers
49 views

How can I make an Actor repeat the action on collision in LibGdx?

I want my EnemyActor to do this SequenceAction when it collides with my bullets. I have already done the collision. Now the problem is that it only does the SequenceAction once when it gets collided ...
0
votes
0answers
42 views

Move player with platform libgdx

I'm learning libgdx and I'm having a problems with moving platforms. I have a bridge class with float values for move_amplitude(distance the bridge moves) and move_time(duration it takes). The bridges ...