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

6
votes
0answers
271 views

Box2D strange collisions (jitter) on sharp edges [closed]

I'm currently developing 2D side scroll game with Libgdx + Box2D. And I'm facing some problems with ChainShape (the ground) and PolygonShape (the cart body) collisions. Please look at this video: ...
0
votes
0answers
213 views

Box2D revoluteJoint Motor speed,Max torque scaling for diff Devices

Hi i am using Box2d Revolute Joint as a joint for wheel it's connect to Wheel and Body of my Car i am using RUBE for creating the Box2D world Prob. i am using a scaling floating point number to scale ...
2
votes
2answers
942 views

how to design and develop game level(stages) [closed]

I need some expert opinion about game level design. I've been developing android game(2D) using LibGDX framework inspired from below sample game. LibGDX sample Drop game I've customized this game ...
2
votes
1answer
402 views

LibGDX Scene2D event handling and bounding box relative to the center of a TextureRegion

I'm experimenting with Scene2D to see if it fits fot the game I want to develop. Say I have an Actor with the origin in the center of its TextureRegion. My setup method contains this code: float ...
0
votes
1answer
2k views

Libgdx explain steps for beginner to create and use image as a box2d body [closed]

I am basically from corona background and new to LibGdx , familiar with stage and actor from scene2D. Now wants to use physics body from box2d in the game besides using actor from scene2D. But I ...
0
votes
1answer
477 views

Movement with box2d using libgdx

I am pretty new to using physics engine and would like to know what is best practice for movement of playercharacters. Currently I have a class called Hero that has a CircleShape and when the user ...
0
votes
0answers
29 views

Trouble loading .png file using LibGDX [duplicate]

I'm trying to load a Texture to libGDX and I'm getting a file not found exception. Here's the code that's trying to load the .png file. ` //Textures private Texture tiles; private TextureRegion ...
1
vote
1answer
2k views

LibGDX Drawing sprites when moving orthographic camera

I've been having this problem for a long time and I just can't seem to find the exact problem. I have a game where the map is 480x1600 and my camera has a view of 480x800. I have a button that when ...
1
vote
1answer
103 views

How do I use warble to package libgdx and ruby?

My ruby code is as follows include Java Dir[File.expand_path "#{File.dirname(__FILE__)}/../libs/\*.jar"].each { |x| require x; puts "go"} module LibGDX include_package "com.badlogic.gdx" ...
1
vote
1answer
343 views

ParticleEffectPool.obtain() not resetting particles

I want to use ParticleEffectPools in libGDX but I'm running into an odd issue where the effects don't seem to be reset when obtained by the pool. The code below looks for an existing ...
3
votes
1answer
1k views

Libgdx , how to get mouse position relative to a Tiled Map

I'm porting a game that i did for Ludum Dare 26, this year, i made it using Contruct2, i decided to port it to Libgdx, for learning reasons, ...
2
votes
0answers
311 views

Choosing a level editor of a 2d platformer [closed]

I'm working with a small team on a 2D platformer game in Java (LibGDX) that uses Box2D for physics. Our team is looking for a tool to make the levels (that we will be able to integrate with the Box2D ...
0
votes
1answer
1k views

Side Menu using Libgdx

I want to make it so that when the player presses start, a side menu slides out and gives a player some option on one side of the screen, similar to Angry Birds or Pokemon. I'm not sure how to go ...
0
votes
1answer
250 views

Tweening in 2d side-scrolling RPG

I'm working on a 2d side-scrolling RPG-ish game. Currently the movement of the main character(hero) is based on the A and D keys, because it's 2d and I don't really care about jumping. I would like to ...
0
votes
0answers
377 views

Libgdx - Box2D: Attach Physics Body Editor Loader mask to dynamic texture

I have a texture of a circle, which gets drawn to a new position when a touch drag occurs. It isn’t set up as a body. I have made a physics map using Aurelien Ribon's Physics Body Editor Loader GUI ...
1
vote
1answer
2k views

Registering InputListener in libGDX

I'm just getting started with libGDX and have run into a snag registering an InputListener for a button. I've gone through many examples and this code appears correct to me but the associated callback ...
0
votes
1answer
268 views

Design question: How to handle input more efficiently?

I'm designing a system to handle the keyboard input for my game. To get it more simple, I have a class that has two methods, KeyUp and KeyDown which tell me which key has been pressed, this is already ...
1
vote
0answers
82 views

How to space actors in scene uniformly? [duplicate]

I have a Array data structure right now, which contains 10 soldiers in my army. They can setup initially in various formations - e.g. o o o o o o o o o o The user can move one of the ...
-2
votes
3answers
218 views

ArrayList mixing up indexes?

Working title. I'm warming up to libgdx and I'm trying to remove objects from an ArrayList when pressed/touched. The Objects are rectangles and about 70% of them get removed, the other 30% just stays ...
0
votes
1answer
198 views

swipe effect problem using only mesh and array - libgdx

I tried to combine matdesl's and libgdx's draw lines algo ang code. but i can only create a line. problem is i want to make a fruit ninja swipe effect but only knows this... problem is i want to make ...
0
votes
0answers
189 views

How to handle Null Pointer Exception in libGDX's Box2D ContactListener?

What's up everyone, I am heuristically producing a Pong clone in Box2D via libGDX. The Null Pointer Exception is originating in the ContactListener's beginContact() method in which I am trying to ...
2
votes
0answers
223 views

How to create heat haze effect in Libgdx?

I would like to create a heat haze effect for a 2D game I am making. Do You have ideas or suggestions, how to get that effect. I am using Libgdx(OpenGL 2.0). Thank You in advance!
2
votes
1answer
1k views

Libgdx loading images

I can't find a sulotions that solves my problem, I've tried pretty much every tip I can find, but with no luck. Error : Exception in thread "LWJGL Application" ...
0
votes
0answers
290 views

pause or freezing game screen

I have a question regarding the pausing/freezing a game while a window/pausemenu will appear at center of the screen. I've already created a pausescreen class which will be called each time the back ...
1
vote
0answers
254 views

Libgdx: scrolling background for preview screen

Good day, I have been coding for quite a while now and I'm at an certain point where i am having difficulties on solving something. I've been creating a preview screen which contains the following: ...
1
vote
1answer
804 views

libgdx: how to manage entity classes [closed]

Good day sirs, I know this is a newbie question but I really need to ask it. I've been reading a lot of sample codes on libgdx, and I have seen entities(player, enemy, boss,etc.). my question is what ...
0
votes
1answer
655 views

Error using Physics Body Editor for LibGDX

In my game, I've been trying to use the physics body editor for libgdx, but I kept on getting an error. So I thought there was probably something wrong with my code so I took the example off of the ...
1
vote
1answer
265 views

How to properly calculate y position when drawing from .fnt bitmap font?

I want to render text to bitmap to use it later as a decal texture. I've read through libGDX fonts drawing code and came up with this: private void writeTextToPixmap(Pixmap destPixmap, Pixmap ...
6
votes
2answers
2k views

How can I post scores to Facebook from a LibGDX Android game?

I am using LibGDX to create an Android game. I am not making the HTML backend of the game. I just want it to be on the Android Google Play store. Is it possible to post the scores to Facebook? And if ...
1
vote
0answers
106 views

How to use HyperLink with Actor in Libgdx

I am making a quiz game using LibGDX. I want it to redirect to a website. I am using classes like Text and Label that extends Actor to write text using a bitmap Font. I have no idea on how to provide ...
3
votes
2answers
3k views

Libgdx ShapeRenderer rectangles

I'm trying to draw a filled rectangle in Libgdx and according to the API this should work: shapeRenderer.begin(ShapeRenderer.ShapeType.FilledRectangle); But it gives me an error and tells me to ...
2
votes
0answers
749 views

Libgdx ParallaxScrolling and TiledMaps

I implemented ParallaxScrolling for my SideScroller project, everything is working but the tiled map (the most important part!). I've been trying out everything but it doesn't work (see the code ...
1
vote
1answer
2k views

Implementing Scrolling Background in LibGDX game

I am making a game in LibGDX. After working for whole a day..I could not come out with a solution on Scrolling background. My Screen width n height is 960 x 540. I have a png image of 1024 x 540. I ...
0
votes
1answer
174 views

Should I make the Cells in a Tiledmap as null when my player hits it

I am making a Tile Based game using Libgdx. I took the idea from SuperKoalio platformer demo by Mario Zencher. When I wanted to implement Collectables in my game , I simply draw the coins using Tiled ...
1
vote
1answer
1k views

Setting Higher Z-Index for Sprite

For my game, I have to set highest z index for my sprite. At present, I wrote following code but didn't work for me. Sprite houseSprite = new Sprite(pX, pY, ...
0
votes
0answers
146 views

Libgdx wallpaper offset change

i have an image that i set as background. I use texture Region for my image. i put this in update method. batcher.begin(); batcher.draw(background, 0, 0, 320, 480); batcher.end(); How could ...
1
vote
0answers
268 views

Create a touchpad-joystick using texturepacker2

I am adding a touchpad control to my game, using TexturePacker for loading images into the image-atlas. I have followed this tutorial to add the joystick. Everything is the same apart from the loading ...
0
votes
1answer
178 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
1answer
293 views

Making Ball Fling in a Curve Direction

I was wondering how to figuring out how to slice a ball (banana kick) by flinging it curve-ways. However, according to the LibGDX's gesture listener, the method for flinging only focuses on a straight ...
1
vote
2answers
994 views

Should I accumulate state time based on a global or a parameter?

Generally, we associate a "state time" with our sprites. Libgdx provides a method to do so: float deltaTime = Gdx.graphics.getDeltaTime(); However, in the main game loop, we have a delta time as a ...
1
vote
2answers
782 views

LibGDX with Android UI

Hello I want to combine between android UI and libGDX. I want to have half of my screen with libgdx engine (animated sprite) and the other half of the screen with android UI buttons. Does anybody know ...
1
vote
1answer
81 views

Images not found in textureregion

Previously I was using simple Texture for sprite based animations, but that did not provide support for images which were not in the power of 2. TexturePacker provides with the ability to load all the ...
1
vote
0answers
210 views

Texture Region drawing issue with LibGDX

I am currently moving my old slick2d project to libgdx. I have created a custom AnimationExt class that extends Animation to which I added a draw method. The Animation's frames are actually ...
0
votes
1answer
404 views

Input events not working simultaneously on android devices in libgdx

I am making a simple platform game in Libgdx... in which I have made the player to move left, move right and jump. The code works fine on Desktop but on Android devices, Jump is not fired when the ...
0
votes
1answer
80 views

Problems implementing a Sign Sprite in Libgdx

I am making a tile based game in LibGdx. I am using the TiledMap in .tmx format. I want when my player reaches a tile whose property is set (tileType -> sign), he should see a Sign sprite and on ...
0
votes
1answer
851 views

how to use texture atlas

I am trying to implement texture atlas. 1) I am using the texturepackerGUI and the result is taking 2 files , one png (whicj contains all the images and one .atlas (and not .pack). 2) Now , I want ...
1
vote
0answers
331 views

TIled map rendering in libgdx

Good day. First of all, some explanation of situation. Init tiled map code: map = new TmxMapLoader().load("maps/map.tmx"); mapRenderer = new OrthogonalTiledMapRenderer(map, 1f / 32f); Rendering ...
2
votes
1answer
389 views

Recording and playing back sounds with LibGDX

How do I record a sound to PCM format and replay it from there?
3
votes
1answer
223 views

How to setup libGDX project only for Android & iOS?

I have developed some applications on android.But now i want to learn game development in Android & iOS with libGDX. I want to only develop for Android & iPhone.I do not want a desktop ...
1
vote
1answer
2k views

how to get width and height of TiledMap in the latest Version of Libgdx

I am making a tiled based game, I want not to let the camera show places, where there is no map... this is a obvious solution I got from a tutorial if(camera.position.x<400){ ...