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
1answer
8 views

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 ...
0
votes
0answers
17 views

libGDX ShapeRender flicker when translated

I have recently started working with libGDX and have encountered a strange bug. When shapes rendered by a ShapeRenderer they appear to flicker/strobe while being translated. My code looks something ...
0
votes
0answers
9 views

Libgdx, Gradle, android package naming problem

I'm upgrading my libgdx project to make use of all the new Gradle stuff. However I changed the package namespace from the default generated by gdx-setup but that hasn't worked: when I debug to my ...
0
votes
1answer
14 views

Libgdx AtlasTmxMapLoader with multiple tilsets

I am working on a Libgdx game which loads Tiled maps. The current map I am working on makes use of two tilesets, one for shadow/light and another for terrain and buildings. The general process I do, ...
1
vote
1answer
14 views

Libgdx Box2D random positions and intervals falling bodies

I need to make that objects fall from the top of the screen random intervals and positions. Here's my code where I create lot of objects and add them to ArrayList private void createBalls() { ...
0
votes
1answer
13 views

Having trouble going from the menu I created w/ Android normally to my LibGDX game file

So I wanted to use Android Studio to create the menu for my game so I created a button with an onClick method that included the Intent i and startActivity(i) but when I clicked the button the app ...
0
votes
0answers
12 views

Creating & loading animation from one class in libGDX

i'm new to libgdx and i wonder if i can create all the animation for my game in just one class so i can just call it to my main game screen class,if it is possible can someone teach me how to do this? ...
1
vote
1answer
125 views

Too many if statements cause lag? [on hold]

I am trying to make a vertical scroller game with collision tiles on both sides. I'm using Libgdx and android studio. The problem is that i have made every tile as an object with a rectangle for ...
0
votes
0answers
17 views

Libgdx tiled map not showing

I'm using a HashMap structure to store and load my maps made in tiled. Currently I have two and I am able to go from mapOne to mapTwo with no problems. But when I go from mapTwo to mapOne, mapOne ...
0
votes
1answer
52 views

Convert transform from world to local space

I have a hierarchical node system. Given a world space transform, I need to obtain the transform for a specific node in local space. My Node class has the following method. public void ...
1
vote
1answer
31 views

2D BoundingBox Collision Detection Problem

I implemented collision detection into my game (using Bounding Boxes) The character is floating above the blocks instead of standing on them. I know what is happening, but I can't figure out how to ...
0
votes
1answer
26 views

Libgdx: more efficient way of using Vector 3?

I currently use if(cam.frustum.pointInFrustum(new Vector3((float)posX, (float)posY, 0))) To check if my sprite is in the camera's view. I have to make a new Vector3 every frame wich is very ...
0
votes
0answers
42 views

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 ...
0
votes
1answer
40 views

How can I communicate between libGDXand the Android Studio Java files?

The reason I'm asking is because I wanted to create a game and I know I could use Scene2D to create the UI but as far as menus go I wanted to use the tools in android studio to at least create a menu ...
0
votes
0answers
50 views

LibGDX: Problems creating custom actor

I am creating a custom class that extends from Actor,just like this: public class MyActor extends Actor { ProgressBar bar; Label nameLabel; TextButton button; public MyActor(String name, Skin skin){ ...
0
votes
0answers
32 views

HashMap or LinkedList

I'm working on a 2D game for Android using LibGDX in Java. In my game I got lots of enemies, bullets and other stuff. I hold a hash map, which every cell holds a reference to an array list of that ...
0
votes
2answers
36 views

How can I make libGDX text buttons look like clickable buttons?

I have this problem with my game where UI build a nice menu and other stuff with TextButtons and labels, but it doesn't look nice because it's mostly displaying the text of the buttons (which don't ...
1
vote
1answer
34 views

Problems managing collision filtering

I have my character fixture and body(is a tank), so when I press the screen it throws a rocket(which also has a body and a fixture) that the player can controlll touching the screen. My game also has ...
0
votes
1answer
44 views

How to make a ball hit many tiled circular objects in LibGDX

Hey guys I've been learning to make games with LibGDX. I did a tiled map in Tiled and the rest of code in java using Android Studio. I could make a ball bounce on the flour using Box2D, but I can't ...
0
votes
1answer
14 views

Libgdx: move img from one point to another?

I'm trying to make an image move towards another point. I only have the current X/Y and the destination X/Y + Speed. That's it. public void Draw(SpriteBatch batch, int goalX, int goalY){ destX = ...
0
votes
0answers
23 views

Libgdx tiled map collision scale problem

I followed Dermetfans tutorials on youtube to make a collision tile map for use in Libgdx and I think I have some scaling problems related to the camera. I'm loading the map and the bottom left corner ...
1
vote
2answers
44 views

Box2D LibGDX Body.getPosition() and Body.getWorldCenter() problems

I have a problem with my game in Java with Box2D and LibGDX I found out that when I use body.getPosition() it is only half of that of body.getWorldCenter(). The problem here is for me that I use ...
0
votes
0answers
20 views

Alternative Sound lib with LibGDX

i'm making a 2D game for Android in Java using LibGDX. I find LibGDX sound management not good enough for me. I wonder if it's possible to use an external lib for playing and managing the sound and ...
0
votes
0answers
14 views

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 ...
0
votes
2answers
44 views

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 ...
1
vote
0answers
16 views

Movement for Box2D Bodies

I'm having trouble wrapping my head around something that should be relatively simple. I'm making a breakout clone using LibGDX and Box2D. I'm also using the Ashley ECS. For movement with bodies, I ...
0
votes
0answers
47 views

Wrong Normal When Models is Close to Each Other

I have a problem regarding my Normal FrameBuffer that creates gaps between models. The image below contains 10x2x10 block (Minecraft style) and one character. The image is outputed through: ...
0
votes
1answer
32 views

libgdx limit angular speed

I'm working on my top-down game. y characters use pathfinding + steering behaviors(Arrive and FollowPath) to move. I've implemented my character class from libgdx SteeringActor class (from tests). So ...
0
votes
0answers
26 views

Libgdx easy peer to peer connection

Background Information Since a few weeks I am trying to create a easy libgdx game... Maybe a bit similar to Binding of Isaac... But theres one thing which I want to implement as soon as possible... ...
0
votes
0answers
13 views

WorldController won't update in Libgdx

I am trying to refactor the code from the superkoalio. If I take out the updateKoala() and I put it in the new class, name it WorldController, it simply won't update the game when I call it from ...
0
votes
0answers
8 views

Maintain actor position when switching screen in maximized form Libgdx

I have for now 2 Screens in my Game. First is Loading Screen which loads the assets and then when I click the screen (I added ClickListener) takes me to other screen which is my Login Screen. Problem ...
0
votes
1answer
16 views

Make a sprite jump to a certain direction in libGDX

I was wondering how you can make a sprite jump to a certain direction in libGDX just like the brick does in the famous mobile game "Amazing Brick' I want to make my sprite jump up a bit to the right ...
1
vote
1answer
33 views

Libgdx spawning enemies at random time

Hello I want to spawn enemies at certain location but at random time,like for example every 10 seconds. Atm I am spawning enemies whenever I click to spawn heroes but with delay, but I sure does not ...
1
vote
1answer
35 views

LibGDX box2d - Jumping not working

I'm trying to make a platformer game using Box2D, but I can't manage to do the jumping. The source code is here: https://github.com/ZacGarby1/Platformer. I have no idea why it's not working because I ...
1
vote
0answers
38 views

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 ...
1
vote
1answer
41 views

Make game camera stay inside of tiled map boundaries [LibGDX]

I am creating a little 2D platform game, with the LibGDX framework. So far I have created a simple prototype level in Tiled, and loaded this map into my LibGDX game. I can use mouse and keyboard ...
1
vote
1answer
49 views

Circle to Polygon collision response

I'm working for collision response for my 2d game. Character is represented by circle and obstacles are represented by Polygons(in my example it would be rotated rectangle for simlification). The ...
1
vote
0answers
18 views

LibGDX: ActorGestureListener after change position

I have this code to get pan touch inside an Image and it works fine, but when I uncomment this line img.setPosition(100, 100); it doesn't work anymore, why? Texture tex = new ...
2
votes
0answers
25 views

Libgdx - multiple images in a group, best practices - also overdraw question

I am trying to right a card game, that will have an image in the middle, a coloured border and potentially a symbol in the top left. I am using libgdx and a stage/scene2d. The image will change ...
0
votes
0answers
37 views

How to dynamically draw a filled polygon with a given array of vertices?

Say I have a simple array of vertices (or floats with every odd index being the X of a vertex and every even being the Y), how could I paint all the area between the vertices? As in, I have maybe ...
0
votes
1answer
33 views

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 ...
1
vote
1answer
34 views

Drawing texture with smaller size results in pixelated image, even after applying filter

Can someone please help me resolve this issue. I've tried searching myself and the common answer suggested is to use a TextureFilter. I've tried doing that multiple times but nothing works. My png ...
0
votes
0answers
35 views

LibGDX Scene2D.UI without Scene2D?

I'm currently programming a little game in LibGDX for which I planned to use Scene2D's UI aspects to make menus and a hud. When fiddling around a bit, I noticed that my Scene2D.Stage basically made ...
2
votes
1answer
39 views

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 ...
1
vote
0answers
24 views

Smoothly fitting texture tiles using alpha gradient on edges

I'm trying to draw a background texture with tiles that I'll rotate and mirror to create a maze. Here is a sample tile: As you can see, I use an alpha gradient on the borders. If I'd use a sharp ...
1
vote
3answers
113 views

Most optimal way to load 2D world

I am creating a 2D car racing game. (Yes, a Hill Climb Racing clone) What I am doing right now is load 10% of the map every time the user gets to 7%. For example: Imagine the map has 10km. (10000m) ...
0
votes
0answers
16 views

LibGDX BoundingBox + pickRay issue

I've been following this tutorial for trying to be able to detect if I have clicked on a 3D model, but am running into some issues. Here's what I have — public GameObject getObject (int screenX, int ...
4
votes
1answer
76 views

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 ...
1
vote
1answer
30 views

find Vector2 libgdx

I need to get coorinates of red point. Coordinates are just for example, it would be better to see the common formula. Found code like this, but it gains wrong result.() Vector2 o = new ...
0
votes
1answer
71 views

Handling Back Button in Android without implementing InputProcessor

Please advice/clarifyon below issue in libgdx while handling back button in Screens. I have already gone through these 2 threads, ...