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

1
vote
1answer
328 views

LibGDX: Smooth movement on a grid based game

I'm making a game with LibGDX where the player is on a grid (like a Chess board). For now, I'm moving the player by teleporting him 16px in a direction. I'd like to use the delta time to make smooth ...
0
votes
0answers
50 views

box2dlights conelight rotation is off

I'm using libgdx/box2dlights for my game~ I have a conelight set up as such: ConeLight cl = new ConeLight(rh, 32, new Color(0f, 0.0f, 0.0f, 1.0f), 3, 0, 0, 0, 1); where "rh" is a RayHandler set to ...
0
votes
1answer
30 views

revolutejoint doesn't seem to rotate

I have a revolute joint set up as such in libgdx + box2d: RevoluteJointDef rjd = new RevoluteJointDef(); rjd.initialize(body1, body2, arm.getWorldCenter()); rjd.motorSpeed ...
1
vote
1answer
134 views

Most efficient way of brighten and darken sprites with OpenGL > 2.0

So I have been shading (brighten/darken +adding color) my sprites by using glTexEnvf with GL_MODULATE and GL_ADD and a vertex color. I only had to rebind the batch every time I needed to change from ...
0
votes
1answer
163 views

Cover Screen with Snowing Effect in Libgdx

Oddly enough I cant find clear instructions on this theme (I only found rain and the method is very particular) so I ask, how do I implement a whole-screen snow-falling effect? The methods i can ...
0
votes
2answers
234 views

Libgdx: movement of scrolling background is not smooth even at 60fps

I'm developing a game and I want to make a sliding background. The background is not scrolling smoothly. I logged the fps, but it was ok. This is my code, I don't know what I'm doing wrong, any ideas? ...
1
vote
0answers
97 views

html5 libgdx project: war to be deployed in a servlet container or only part of the contents to a web server

I am new to compiling games with libgdx to be played on the web and I have some doubts perhaps someone can point me in the right direction: Using the new gradle setup I wrote a simple game to learn ...
0
votes
2answers
279 views

How do you create fnt (angelcode format) files from existing bitmaps?

I often gets the same problem: Someones creates a nice bitmap font for me in form of a sheet nicely formated into a png, like this: ...and i need to create the angelcode .fnt atlas for using it ...
0
votes
1answer
128 views

Create 2D sprites with libGdx using a shape and a texture separately

I am creating a 2D game with LibGdx that will have creatures that are generated from dozens of characteristics with potentially millions of unique combinations. For each segment of each creature, I ...
0
votes
1answer
54 views

TiledMap resizing and aspect ratio with LibGDX

I'm making a game and I don't know how to resize my TiledMap when the window is bigger but keeping its squared shape. Here is a screen: When I change window size, here's what happens: I want ...
1
vote
1answer
262 views

Android LibGDX game: Choosing starting activity

I am making a Android game with LibGDX (using ADT eclipse bundle). How do I choose the default activity to launch when the user opens the app. I set the project up with the LibGDX setup GUI, and I ...
0
votes
1answer
108 views

libGDX SpriteBatch reuse

Using libGDX, sprites or simply texture regions must be inserted into the batch for drawing: void render() { batch.begin(); batch.draw(...); batch.end(); } Is the VBO being uploaded ...
2
votes
1answer
250 views

Conceptual - What is the optimal way to combine steering behaviors with rigid body physics?

I am working on a simple 3D space simulator that makes use of the Bullet physics engine. The spaceships are rigid bodies that have a mass and hitbox so that they can be considered for collisions. At ...
0
votes
1answer
52 views

Resizing the window moves and stretches the texture

I have a basic screen with 3 TextureRegions rendered on the screen rendered with this code(Ignore the hardcoded numbers, bad decision I know will be replaced later): Gdx.gl.glClearColor(0, 0, 0, 0); ...
2
votes
2answers
128 views

how do I create a moving type of block like in Mario[box2d]

I want to create a block which only moves up and only when hit from below. I am trying out a distance joint and I read it can be used as a spring, is this the correct solution? the way I have tried ...
3
votes
1answer
1k views

How do I generate mipmap .png and model .obj files for LibGDX?

I'm playing a bit with LibGDX (OpenGL ES 2.0 wrapper for Android). I found some sample code which used prepared files to load models and mipmap textures for them, e.g., at ...
1
vote
1answer
252 views

How do I combine images into a single entity in libgdx?

I've googled this but can't seem to find anything on "concatenating" two images, especially with libgdx. Any ideas?
0
votes
2answers
175 views

Smooth camera movement between followed objects

I have 2d game where my camera follows the player. Simplified, it copies the player position as its own. Now I have some other object in the game, that I want to camera to follow. This is easy enough ...
0
votes
0answers
46 views

Box2D and randomly generated tilemaps

I am making a 2D Terraria-style sidescrolling game. I want to use box2d for the physics. However, I am using tilemaps for the maps, and I do not know of a processor-efficient way to use Box2D bodies ...
7
votes
2answers
651 views

How can I make a snake's tail follow the head?

Following an assignment and just getting started with libGDX by building a small Snake clone I've run into an issue that I'll probably be ashamed for in a little while. I currently have a snake's ...
2
votes
1answer
880 views

2D game world creation (libGdx, java)

I'am starting to develop a 2D game with motorbikes. My Question now is: When my bike reaches the right edge the world should move. (Like in that game: Game example) My first thought was to implement ...
-1
votes
2answers
84 views

How to implement “move to touch location” function?

What is the formula/logic to implement moving an object towards a TOUCHED location. I want character A to move to my finger and it must be accurate. Here is what I have tried so far: @Override ...
1
vote
1answer
226 views

LibGDX keep camera within bounds of TiledMap

I have a simple TiledMap which I can render fine. I have a player hopping (with Box2D) around and my camera follows the player around: cam.position.set( player.position().x * Game.PPM + ...
0
votes
2answers
121 views

Conditionally use java or android classes

I'm using bezier curves in my libgdx project. I was testing the desktop version using java.awt.geom with GeneralPath but when I went to test on android, it raised an error saying that I can't import ...
1
vote
2answers
92 views

libgdx: How do you remove a cell from TiledMap?

I am making a Terraria-style sidescrolling game with an open world. I am using a TiledMap to render all of the tiles. If I want to remove a tile, like if it is broken, how would I stop it from being ...
-1
votes
1answer
53 views

Game slow with older phone [closed]

I've made a game using libgdx. On m'y HTC One X, the game works good, even if there are some lags but only at the beginning. I wanted to try it on an older phone (well a less powerfull phone), a ...
3
votes
1answer
309 views

How can I create a fade effect between scenes in Libgdx?

I have implemented a screen fade with Scene2D. It currently fades fades out of one screen to black, then then from that black into the next screen. It would be really awesome if I could fade ...
1
vote
1answer
192 views

How to start an animation just once on an event in libGDX

I am trying to show an explosion animation which i created using a few textureregions and created Animation missileblastAnimation from those textureregion like this -- > TextureRegion[] explosion = ...
0
votes
1answer
105 views

Parse and iterate over SVG path

I need to parse a SVG path expression like m8,295c-4,-292 441,-291 446,-26c5,265 440,263 442,-9 and have a way of iterating over it in [0 ... 1]. I looked into Apache Batik but it doesn't seem to ...
1
vote
1answer
97 views

Why is my text is too large even when scaled to .05f in libGDX?

I'm trying to scale down my fonts as my game objects are also small. I'd like to scale them down the same way as my sprites. However, if I scale them below .05, the font disappears! My attempt at ...
0
votes
0answers
37 views

libGDX Tilemap spritesheet size requirements?

I'm having an odd problem with libGDX. I have two spritesheets: http://postimg.org/image/iqj2w03sn/ and http://postimg.org/image/ofzbgb9yv/ [These sheets are from the Pokemon essentials builder ...
2
votes
2answers
195 views

How do I make a puzzle piece move smoothly between locations?

I'm building a 2048 clone to sharpen my Libgdx skills, but I don't know how to ease a tiles between board locations. When I slide my finger, the tile moves rather swiftly. How I can make the movement ...
5
votes
3answers
396 views

Creating Platform game with Inclined Levels

Till now I have developed platform games in which a player can only move and detect tiles linearly. I wonder on how to implement games in which a player can move on an inclined or irregular surface. ...
2
votes
1answer
65 views

RGBA values not coming as intended | LibGDX

As it states, my RGBA values aren't coming out the way I want it to be. My RBGBA values are As it states, I am trying to create a orange tinted color on my game. 221, 189, 98, 0.7 I am using a ...
1
vote
1answer
290 views

Libgdx collision detection and response

I am trying to create a simple platformer game with libgdx. I implemented a collision detection for the player's bounding box with the map's tiles using the Rectangle.overlaps method. In response I ...
1
vote
0answers
360 views

How to correctly set window size in Libgdx scene2d.ui dialog

In my libGDX application I am using the scene2d.ui classes to render my game's GUI. One of the things I render via these classes is a dialog window with a background image set. I have created the ...
2
votes
1answer
91 views

Using Box2d to model rotating turret

I would like to model a rotating "turret" on top of a tank-like object in 2D from the side view like pictured here: Notice the faint outline of a gun protruding to the upper left courtesy of ...
1
vote
0answers
2k views

TileMapRenderer in libGDX not drawing anything

So I followed the tutorial on the libGDX wiki to draw Tiled maps but it doesn't seem to render anything. Here's how I setup my OrthographicCamera and load the map: camera = new ...
7
votes
3answers
5k views

Advantages and disadvantages of libgdx [closed]

I've been an android developer for a while and am thinking about getting into gaming. While looking for a game dev framework, I thought libgdx provides very friendly documentation and functionality. ...
0
votes
0answers
282 views

Libgdx and ParticleEffect with scene2d not showing the same way as in the Particle Editor

I am developing a new game with libgdx and trying to implement ParticleEffect in scene2d (using actor). I am creating a ParticleEffect with Particle Editor in which I would like to add to a stage. ...
0
votes
1answer
71 views

my movement is working good on keyboard but on android its not

So basically here is what my movement is like for keys: key down if (keycode == Keys.LEFT) { mishi.getAcceleration().x = -13; } key up if (keycode == Keys.LEFT) { ...
6
votes
3answers
2k views

How do I render a PNG with transparency in LibGDX?

I'm building a simple tic-tac-toe example with LibGDX. I have simple images: cross, circle and board, all pngs created with GIMP with a transparent background. How can I render them as a Texture with ...
0
votes
0answers
65 views

Using libgdx to display different textures above and below generated terrain

I'm working on a Scorched Earth clone using libgdx. So far I've been able to dynamically generate the terrain as seen in the screenshot below: The polygons below the terrain surface are currently ...
0
votes
1answer
144 views

Two issues with testing LibGDX on Android

1) When I test my game on desktop it is 100% fine. When I test it on my Nexus 7 physical device, it is the same except the backgrounds have no color. For example my splash screen has a greenish ...
0
votes
0answers
105 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 ...
1
vote
1answer
303 views

What is the delta value passed to the Screen's render method?

The delta value given to the render method in the Screen class is a non-constant number. What is it? Where does it come from? Does it differ by screen size?
0
votes
1answer
152 views

How to add a nice looking muzzle flash to the tip of my guns [closed]

I am making a top down shooter and would like to add a muzzle flash to the tips of my guns. So I have an idea of what I want to do which would be just a circle that would fade from yellow to white or ...
0
votes
0answers
78 views

SelectBox in LibGDX doesn't display and freezes the program after a click

I am currently trying to apply an overlay with LibGDX over my 3D ModelBatch. Everything works fine except for the SelectBox. Once instanciated, it shows up on my screen I can click on it once but then ...
0
votes
0answers
84 views

How to make good looking bullets with a trail for top-down shooter?

So I am making a TD shooter and was wondering how to make fancy bullets. Right now I have a giant sprite of a bullet trail that is the bullet as well but it doesn't look that good. I am using libgdx ...
0
votes
1answer
63 views

Is there any reasons to make sprites and bodies line up?

So in LibGDX the Sprite objects position is where it's 0,0 mark is in the word. In Box2D a a bodies position is in it's center. So to line these up when you update the sprites position with the ...