Quantcast
Channel: Question and Answer » libgdx
Browsing all 434 articles
Browse latest View live

Libgdx – when / how to save data

I’m making a simple 2D game in libgdx, and now I’m at the point where I have to save data. I already have a mechanism to save the data itself. The problem is that I don’t know when/where the procedure...

View Article


My characters do not reverse their velocity, why? libGDX

I have been programming my game in libGDX for a while now and even watched a tutorial on youtube from Brent Aureli. The game I’m going for is kinda like Super Mario Bros but there is one problem that...

View Article


Native vs Framework development for simple board game development [closed]

I have been working on a simple word game like Hangman Pro but for a different language and I have been using libgdx blindly. After a lot of hassle and unnecessary distractions, I am beginning to...

View Article

LibGDX: Do I have to dispose a texture if I load it from AssetManager?

AssetManager manager = new AssetManager(); manager.load("texture1", Texture.class); manager.load("texture2", Texture.class); manager.load("texture3", Texture.class); //And so on... And then I load it...

View Article

Should texture regions sizes be power of two?

Is it advisable for my individual texture regions inside this texture to be power of two, or that won’t make any difference? I’ve read on several places that it’s recommended to use power of two sized...

View Article


Image may be NSFW.
Clik here to view.

Libgdx inaccurate collision detection (no body2d)

So, I am developing a simple 2d game that has no need of body2d or over physics engines. I make my bodies update position by adding a specific velocity to them. The problem arises when I try to make my...

View Article

Image may be NSFW.
Clik here to view.

Round position to center of current grid position

The title may not make sense, nor may the question – I’ll try nevertheless. I’m attempting to make a game similar to The Powder Toy. Essentially, this is a physics simulation game, where the users...

View Article

Image may be NSFW.
Clik here to view.

Convert MathAtan2 angle to degrees

I use an angle to set the velocity (or direction if you prefer) of my sprite, however, I want the sprite to be heading in the same angle as I’m moving, rotating according to that angle. How I set angle...

View Article


Image may be NSFW.
Clik here to view.

libGDX : Paint And Remove Color From Actor with touchDragged

I created two-dimensional array of Button actor, then I added new ClickListener() { touchDragged } as the following code: buttons = new Button[3][3]; for (int row = 0; row < buttons.length; row++) {...

View Article


Image may be NSFW.
Clik here to view.

How to close an app correctly on desktop?

When I use Gdx.app.exit() the game window closes but the resources don’t appear to be released and the app is still running. For instance, to exit on when the escape key is pressed: public boolean...

View Article

Using LibGDX, is it necessary to clip what I'm rendering for efficiency?

So I am working on a game, and I’ve noticed that everything in the world is sent to be rendered. Of course with the camera, only some of the world is rendered. Does this mean there is there any expense...

View Article

Adding an InputListener to a Group

I’m trying to detect when a Group actor (my “slot”) on my stage is clicked by add an InputerListener to the group. I’ve added the stage to my InputMultiplexer, but when I click on the actor, nothing...

View Article

OpenGL — Better to switch out material or shader for changing object colors?

I’m fairly new to shaders and OpenGL so bare with me please, I just want to make sure I’m doing it correctly! Now I’m using LibGDX in order to create a simple 3d diagram for my company. I have a few...

View Article


LibGDX – Level management on a level-based game

I’m new to LibGDX and android development in general and am trying to do a puzzle game. Being a level-based game, i’m trying to make it so in every level a certain number of blocks (just rectangular...

View Article

Image may be NSFW.
Clik here to view.

How do I implement tilt controls that work even when the device is not vertical?

I’m using libGDX to develop an Android game. The main character can be moved freely in the 2d plane by tilting the phone. The relevant part of my current implementation looks somewhat like this:...

View Article


Image may be NSFW.
Clik here to view.

Libgdx rotate sprite with collision

Im making a game where I have an object in the center of the screen and then balls come out from the sides of the screen. When you touch the screen the object rotates 90 degrees clockwise and it has to...

View Article

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....

View Article


Libgdx crash on dispose()?

Whenever I try to manually call the dispose method in one of my screen my game just crashes. My dispose looks something like this @Override public void dispose() { battletheme.dispose();...

View Article

2D Voxel Game Chunk Question

I’m currently working on a 2D Voxel game. I started with a big blocks array with all blocks inside it, but it is not very good for performance, so I’m currently switching over to chunks. My question is...

View Article

Image may be NSFW.
Clik here to view.

Moving box2D body with texture?

I was following the solution from this http://stackoverflow.com/questions/20180063/box2d-body-with-texture. I ended up getting this working for static bodies. But when trying to get the PolygonSprite...

View Article
Browsing all 434 articles
Browse latest View live