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

-4
votes
0answers
23 views

Jumping Physics [on hold]

With simplicity, how can I make a basic jump without the weird bouncing? It jumps like 2 pixels and back Here's what I use y += velY x += velX then keypresses MAX_SPEED = 180; falling = true; ...
1
vote
1answer
32 views

Box2D body rotation with setTransform

I' having a problem rotating a body with setTransform(), The body has multiple sensors that should rotate with the player. The rotation works but it rotates around the bodys local 0,0 position instead ...
0
votes
2answers
34 views

Libgdx, find Vector3 direction

I am using Libgdx along with Bullet physics. I have a vehicle moving. I would like to use a ray from the vehicles origin and in the vehicles forward direction. How can I create the forward Vector3 ...
0
votes
0answers
8 views

LibGDX: Why look BitmapFont pixelated on a scene2d.ui.Dialog?

When I use BitmapFonts directly on the stage table, the fonts looks normal (not pixelated). But when I use the same BitmapFont with the same size on a scene2d.ui.Dialog, the font looks pixelated. ...
1
vote
1answer
84 views

libgdx get rotated sprite coords points

I would like to get the position of each edge of a sprite when he has been rotated. I have no idea how to do it, I made a image to explain it. I would like to get the X and Y position of each Red ...
2
votes
2answers
184 views

Problem to match font size to the screen resolution in libgdx

I'm having problems to show text on my game at same size on different screens, and I did a simple test. This test consists to show a text fitting at the screen, I want the text has the same size ...
-3
votes
2answers
25 views

(libgdx) Button doesn't work [on hold]

At the game I choose StopScreen. At this screen displays button. But if I click it - it doesn't work. What I expect - when I press button it must restart game. At this stage must display at least a ...
1
vote
2answers
20 views

LibGDX . draw multiline text

I am trying to write a big text using BitmapFont in libGDX . But it shows on one line and the user can see only the first part of the text . How can I make that bitmapFont made new line automatically ...
0
votes
2answers
193 views

How to implement a game launch counter in LibGDX

I'm writing a game using LibGDX in which I want to save the number of launches of a game in a text file. So, In the create() of my starter class, I have the following code ..but it's not working ...
1
vote
2answers
128 views

How to make an Actor follow my finger

I'm back with another question that may be really simple. I've a texture drawn on my spritebatch and I'm making it move up or down (y-axis only) with Libgdx's Input Handler: touchDown and touchUp. ...
3
votes
2answers
709 views

libgdx game not disposing

My game does not exit entirely even after calling dispose() method. It loads a black screen when I launch it for the second time and works well if I kill the game manually and restart it. I get an ...
1
vote
1answer
107 views

Setting uniform value of a vertex shader for different sprites in a SpriteBatch

I'm using libGDX and currently have a simple shader that does a passthrough, except for randomly shifting the vertex positions. This shift is a vec2 uniform that I set within my code's render() loop. ...
0
votes
0answers
46 views

2d libgdx: runtime level generation

I have encountered a problem during my first game development: I thought of a Array<Ground> groundArray that does groundArray.add when a new ground will appear on the screen, and removes oldest ...
2
votes
2answers
68 views

How to increase the acceleration of an object on the Y axis? [duplicate]

So far I am able to make the character fall at a constant rate but I am unsure how to make the character accelerate while falling. When the character is falling I have a line of code as such: ...
-1
votes
2answers
63 views

How to use the zoom gesture in libgdx?

I found the example code for the GestureListener class, but I don't understand the zoom method: private float initialScale = 1; public boolean zoom (float originalDistance, float currentDistance) { ...
1
vote
0answers
13 views

Manage Admob Between Classes [on hold]

I have a problem with ads because i want to disable the banner of ads in the game activity. I tried to use this guide https://github.com/libgdx/libgdx/wiki/Admob-in-libgdx#control but application ...
4
votes
3answers
186 views

How do I change the relative origins of a Box2D World and a TiledMap in Libgdx?

I'm playing around with Box2D and TiledMaps and I've come across this minor annoyance. As you can see, both Box2D and TiledMap render at the center of the screen. This forces me to compensate by ...
0
votes
0answers
113 views

Collision in Tiled Map - LibGDX

I have collision code that deals with left or right or top or bottom. I am using Tiled Map with LibGDX. Question is: How do I detect collision with other cells by all 4 sides, and not specifically ...
0
votes
0answers
35 views

Map rendering Libgdx Java [on hold]

Ok, so I am trying to create a 2D non-movable random tiled map. This is what I have so far: private void generateTile(){ System.out.print("tiletry1"); while(loadedTiles != 8100){ ...
0
votes
1answer
42 views

LibGDX - Textures rendering at wrong position

Update 2: Let me further explain my problem since I think that i didn't make it clear enough: The Y-coordinates on the bottom of my screen should be 0. Instead it is the height of my screen. That ...
1
vote
2answers
134 views

What datastructure would you use for a collision-detection in a tilemap?

Currently I save those blocks in my map that could be colliding with the player in a HashMap (Vector2, Block). So the Vector2 represents the coordinates of the blog. Whenever the player moves I then ...
1
vote
1answer
47 views

Design pattern for animation sequence in LibGDX

What design pattern to use for sequence of animation that involve different actor in libGDX. For example I am making a game to choose a wolf from a group of sheeps. The first animation played when the ...
0
votes
1answer
82 views

Libgdx actor bounds are wrong

The Actor's boundaries are not centered at the ButtonText but I used the setBounds() method. The higher the Y position is, the less centered is the boundary. The weird thing is that i only created ...
0
votes
0answers
28 views

Parabolic throw with set Height and range (libgdx) [duplicate]

Currently i'm working on a minigame for android where you have a rotating ball in the center of the display which jumps when touched in the direction of his current angle. I'm simply using a gravity ...
1
vote
1answer
68 views

Libgdx 2D Game, Random generated World of random size, how to get mouse coordinates?

I'm a noob and English is not my mothertongue, so please bear with me! I'm generating a map for a Sidescroller out of a 2D-array. That is, the array holds different values and I create blocks based ...
-1
votes
0answers
9 views

LIBGDX “parsing error emitter” with 2 or more emitters [closed]

I have a problem with the use of particle effect of LIBGDX with 2 or more emitters. After using ParticleEditor to create my .p file, I use it in my code BUT...when I use only 1 emitter it's fine but ...
0
votes
1answer
15 views

How to initiate a TCP secure connection using LibGdx to a remote server?

Can anyone point to a link or share with me a piece of code which does: - Base on LibGdx (Gdx.net package) - Use a TCP secure connection to connect to a remote server Many thanks
1
vote
1answer
266 views

LibGdx sprite rotation vs Box2D physics rotation problem

LibGdx sprite rotation vs Box2D physics rotation problem Tearing my hair out on this one. I am an experienced software developer, but very new to LibGdx and Box2D development. I am writing a game ...
-2
votes
0answers
23 views

Adding HighScore [closed]

I want to add a HighScores to my High Score Screen. Now when I start playing the game the score starts and just goes up. Then when the game is over I wont the highest scores to go adding to the ...
-1
votes
0answers
20 views

Libgdx MainMenu [closed]

I am making a menu for a libgdx game. In my menu I have only one button. I have tried to code it but every time I lauch the game it just closes. Here is my MainMenu class: public class MenuScreen ...
0
votes
2answers
986 views

SpriteBatch being drawn outside of Stage?

Currently working on my first game, though running into some problems with libgx and screen aspect ratio. What I have is a Stage which contains things like menu buttons etc, and the rest of the game ...
-1
votes
1answer
34 views

LibGDX Json not parsing full file

I'm trying to load a World with different Objects (World Objects and Entities). For that, I want to use Json. For less than two elements this works like a charm. But as I add more elements, some ...
-1
votes
0answers
25 views

rotate the image as finger move

I am facing a problem when rotating an image as my fingers move. I am getting a small deviation. Can anyone help me to resolve the problem in this code? public void touchDragged (InputEvent event, ...
0
votes
0answers
28 views

LibGDX - How to move Actor with fingers Code?

I am completely new to Game Development. I See all these Questions and Answers and Codes and I have no clue what to do with them. I need some Guidance. My Plan: I want my Actor to move up and down, ...
0
votes
4answers
82 views

Accurate sprite rotation with mouse movement

I am using the current mouse position to aim the player sprite, but I am not getting the best results. It will often by off by a noticeable amount, or even a complete ~180 off if I go from one side, ...
1
vote
1answer
67 views

Does scaling affect performance in OpenGL? [closed]

I've never been able to understand the best practice in this context. I usually want to ship my game with as minimum size as possible. So whereever possible, I try to use scaling of my graphics. Let's ...
-3
votes
0answers
28 views

Selecting interstitial advertisement companies for android

I'm developing an android game using the libgdx framework, and have reach a notorious doubt, what's a good way to place advertisement into my app. My first choice are interstitial advertisements, ...
0
votes
1answer
50 views

Rendering tilemaps at a specific position libgdx

I'm making an endless side scroller game like gravity guy with libgdx. To test this I'm just creating two tiled maps with the same .tmx file to render then one after another, like: ...
1
vote
2answers
38 views

Unable to draw single particle effect at two places

I am using Libgdx ParticleEffect to draw a fire particle effect . The issue I have is that when I try to render a ParticleEffect at two different locations within single game loop, only the last ...
0
votes
2answers
110 views

How do I switch between the game screen and score screen without redrawing everything?

I'm working on a multiplayer game in Libgdx and want to display the scores of say, the top 10 players on the map. The player should be able to checking the scores at any point during the game and ...
0
votes
1answer
35 views

How can I create a button with an image in libGDX?

I am new to LibGDX. I am trying to develop a game for Android (so it will support different screen sizes), but I don't know how to put a button with an image. I tried ImageButton but I can't resize ...
0
votes
1answer
21 views

LibGDX - Accelerometer Problems

I got some issues. I'm using LibGDX. When I hit an object, my Fighter is supposed to fall to the Ground. BUT, because of the Accelerometer, i can still move it up and down eventhough it died. The ...
0
votes
2answers
2k views

Detecting key press only once in Libgdx [duplicate]

Have a question on keyboard inputs. Currently I am using this method to read my input, Gdx.input.isKeyPressed(Input.Keys.A), it is working fine. But I do realized at times there are multiple instances ...
0
votes
0answers
18 views

Cannot draw around the screen after zooming out with LibGDX projection coordinate

I've just started developing game in android using LibGDX. I've follow some samples and now my simple game can draw path when user move their finger around the screen. now problems appear when i add ...
0
votes
0answers
22 views

setRotation in touchDrag

I have a problem, have Actors that represent game pieces. What I'm trying to do is make it so the player can click-and-drag the tile to move it around one fixed position in the screen and rotate. I ...
0
votes
2answers
695 views

Problem with AssetManager while loading a Model type

Today I've tried the AssetManager for the first time with .g3db files and I'm having some problems. Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: ...
0
votes
1answer
32 views

Swiching screen at collision LIBGDX

I am programming with LIBGDX and I am working with a piece of code. What I want to happen is that when the BUCKET collides with a DROP the game switches screens back to the menuScreen. I have tried ...
1
vote
1answer
94 views

Multiple enemy array in LibGDX

I am trying to make a multiple enemy array, where every 30 secods a new bullet comes from a random point. And if the bullet is clicked it should disapear and a pop like an explosion should appear. And ...
-1
votes
2answers
335 views

Publish android game only for 800 x 480 resolution in portrait mode

I have developed a game in libgdx. I worked for long and after finishing, I found that the game runs perfectly only on devices with resolution 800 × 480. I found this solution: ...
2
votes
1answer
126 views

Is there a difference in these two ways of rendering sprites?

I use an OrthogonalTiledMapRenderer: renderer = new OrthogonalTiledMapRenderer(world.getMap()); and I wonder if there is a differnce between this call: renderer.getSpriteBatch().draw(sprite, ...