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
3answers
30 views

Rendering Tic Tac Toe Cross and Circle in libGDX

I am new in LibGDX. For learning purpose, I am creating TicTacToe and I spent two days to figure out what went wrong with rendering the cross and circle. Whenever I click on the cell, the cross and ...
0
votes
0answers
12 views

Java (libGDX) - Inheritance problems

I'm having some issues with inheritance for one of my libGDX projects, I'm making a game similar to (very stripped down) Terraria or Starbound and I am using the TiledMap to load the world, ...
0
votes
3answers
79 views

Which is the best method implementing a background scrolling for game in libgdx?

My question is very simple I am new to libgdx development, which is the best approach implementing a background that is to make the background move in y direction 1)My First approach is drawing the ...
1
vote
1answer
104 views

Rotating towards a point in Box2D

I'm using Box2d as my physics engine and I'm trying to solve what would normally be a simple problem but what has become a nightmare for me and preventing me from finishing my app. (6 months work) ...
2
votes
0answers
24 views

Why is libGDX's HexagonalTiledMapRenderer adding extra space?

Why are there large spaces between the hexes when rendered by HexagonalTiledMapRenderer? The tiles ARE black bordered, but that doesn't account for all the extra space. I was also able to get them ...
0
votes
1answer
60 views

LibGdx Scalling sprites on Android

I have a sprite that is a few buttons but need them in the center of the screen for all android devices. I tried setting it's location to the center of the screen by dividing the orthogonal camera by ...
3
votes
1answer
36 views

Android TV game development

Anybody develop games for Android TV? Especially with libGDX? I would like to know what game controllers Android TV uses? And whether we can use libGDX to control the game controllers?
0
votes
1answer
20 views

In Scene2D, does Actor.hasActions() no longer exist?

Eclipse does not allow me to do while (actor.hasActions()){} saying it's undefined for type actor, but the libgdx API still has it as one of an Actor object functions.
0
votes
1answer
39 views

Stopping Actor tap/click event from propagating

I've been struggling with this for hours now and have read posts, docs and libgdx sources to better understand what's happening, but I still can't make any sense of this. I want to accomplish ...
0
votes
1answer
434 views

libgdx ActorGestureListener.pan() parameters not moving actor in smooth line

I override the pan method in ActorGestureListener to implement dragging actors in libgdx (scene2d). When I move individual pieces on a board they move smoothly, but when moving the whole board, the ...
1
vote
1answer
118 views

Libgdx understanding screen size

I'm trying to create my own jumper type game where the player moves up through an infinite y value. The problem I am having is getting the screen size to match up with the android screen. viewport ...
1
vote
3answers
79 views

How to make sure that when two bodies collide, there is only one collision detection on box2d?

I'm using LibGDX with box2d, and when to bodies collide collision is detected multiple times. here's the code `public void preSolve(Contact contact, Manifold oldManifold) { Body a = ...
0
votes
0answers
7 views

Independent Column sizes in Scene2D Table in LibGDX

For my game's (mostly GUI based) UI i am using table from Scene2D in libGDX. I want independent column sizes in my table but first cell width is the width for all other rows in column. Is it possible ...
0
votes
1answer
83 views

LibGDX make an object rotate around something

I need to rotate and object, which should be a circle made up with a ShaderRender, around a specified point. In LibGDX there is a method or something which allow me to do this? If it doesn't exist how ...
1
vote
2answers
17 views

applyForce as long as display is pressed

In my project I have my main character body. I want it to move down on the y-axis as long as the screen is pressed. I tried it with public boolean touchUp(int screenX, int screenY, int pointer, int ...
0
votes
1answer
26 views

dynamic body jumping out of water object

In my game I have my main object, a jetski, which will dive down into water, when the screen is touched. I managed to code the jetski diving down, with Box2d and some buoyancy forces. But when the ...
0
votes
2answers
367 views

Basic 2d platform collision detection algorithm has a slight bug (Java)

I'm trying to implement collision detection between Player (the main character) and a Platform. They are both modelled as rectangles; when player hits the side of a platform he should bounce off it ...
3
votes
1answer
184 views

How do I make my main character move towards an object? LibGDX/Java

What I want to happen is for my player to bounce from spring to another. For example take the illustration below: Here's my code (what I've tried to do so far). This gets called in an ...
2
votes
0answers
41 views

Dialog/event system in Java/libGDX

I hope that I'm posting this correctly as I'm new to the site, feel free to correct me if I'm in the wrong spot. As for my issue: I'm working on an 2D side-scrolling platformer game in libGDX, and ...
0
votes
1answer
15 views

Black screen when launching on phone

I am coding a game in libgdx. While adding the background I used the html module to watch the results fast and easy on my computer. But when I try to see it on my phone I just get a black screen. My ...
0
votes
1answer
12 views

How to rotate libGDX particle to face the direction of movement

I'm creating spark particle effect so I created simple horizontal spark texture. Here is what I currently have If I change rotation property, I get this But i want to rotate particle to face ...
0
votes
2answers
120 views

Game lags when my player collides with a specific object (solution known, unsure how to implement)

I'm developing a game in Android using LibGDX (although this is more of a JAVA problem than an engine problem). My aim is to have my player bounce off one spring onto another that will eventually take ...
1
vote
2answers
929 views

Matrix rotation wrong orientation LibGDX

I'm having a problem with matrix rotation in libgdx. I rotate it using the method matrix.rotate(Vector3 axis, float angle) but the rotation happens in the model orientation and I need it happens in ...
1
vote
1answer
506 views

LibGDX - Box2D: Realistic Light and Layers

I'm having some problems with my current game. Short description: It's a 2D game where you have to avoid the lights or you lose HP. My problem is the following one: Here is the rendering process: ...
0
votes
2answers
142 views

LibGDX particle emitter rotation

I have a libGDX game, in which I'd like to make some ice breath like effect using particles. So far we made a cone like effect. I can obtain and render it on the screen with this. ...
1
vote
1answer
30 views

libGDX fileHandle cannot readString()

I have created a text file called "useraccounts.txt". All I want to do is to read the file using the filehandle class but I always get this exception: Exception in thread "LWJGL Application" ...
1
vote
2answers
34 views

Camera controll in Libgdx

I've a condition in my game where, I want my camera to follow the Player(its a body from Box2d) and in some not. This is the start screen of my game: Now, when i press a button(space) the player ...
0
votes
2answers
503 views

LibGDX , Scale button with animation when it is pressed

I am developing game using LibGDX . I want to create beautiful menu and to scale buttons when they are pressed but not in this way , when it is pressed scale it 1.5f , I want to scale it with ...
1
vote
1answer
469 views

Changing Box2D Body from Kinematic to Dynamic after contact

What is the correct way to change a Kinematic body into a dynamic body? context - I have a dynamic body as a projectile which has to be fired at a kinematic body (it is kinematic because i am ...
0
votes
2answers
380 views

Card game - creating card Listener

I am making a card game where there are 21 cards on hand and 2 options from where user can draw cards to his hand and throw a card from hand. I am new on game development and I'm following the ...
0
votes
1answer
999 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
2answers
842 views

Sprite rotation LibGDX

I'am using the current mouse position to aim the player sprite, but I am not getting the best results. I want my sprite to have the direction pointed wherever my cursor is in the screen. Here's my ...
3
votes
1answer
367 views

Word game - board implementation?

I'm working on a boggle type game for android, using libgdx. The user is presented with a 4x4 grid of letters and must find words by dragging their finger over the letters. Unlike boggle I want used ...
0
votes
0answers
29 views

LibGdx - APP42 Cloud API Java SDK - weird crash at insertJSONDocument

I'm using App42 Cloud API for saving user data. I created app in App42 console, added the keys in my code. But when I try to upload the data to the cloud, the app crashes. try { appStorage = ...
1
vote
1answer
51 views

2D grid based game merging boxes

Basically what i have at the moment is a tile based game with a grid containing a number of colored cells. this is what i've done so far The prinipal idea of the game is that the user has to ...
0
votes
1answer
53 views

2D Collision Response

I am trying to implement collision response in my libgdx game. I'm using Rectangle objects as my bounbing boxes. This makes collision detection very easy, however I can't quite get the response ...
1
vote
1answer
68 views

How can I update a Stage-based HUD from another Stage's Actor in libGDX?

I feel like this is a simple problem, but I'm having issues finding the correct search terms. I have a Screen that includes two Stages. The first, stage, contains a number of objects deriving from ...
0
votes
1answer
105 views

Scene2d Stage Actor setup issues

I am creating a game using libgdx. In the same each level has a class. I have stage as a member variable of the class. To this stage, I add actors. Inside the levels class, I have attaced the input ...
1
vote
1answer
52 views

LibGDX - Show a minimap

I've started to develop a small roguelike game in LibGDX. I've also made a minimap class, which creates and updates the minimap as the player explores the dungeon, by using a Pixmap. The minimap class ...
1
vote
1answer
25 views

How to draw a BitmapFont every user click

Im starting learning the libgdx framework and I want to "clone" some games. I know how to handle touch with if(Gdx.input.isTouched()) But how do I render new fonts every time user clicks on the ...
0
votes
2answers
234 views

LibGDX - Best way of scrolling background

I'm new to LibGDX and i'm trying to implement a screen where i have a guy running and the ground under him scrolling to give impression he is really running in a sidewalk for example. The ground ...
0
votes
2answers
173 views

libgdx texture edge blending problem

I have two completely white bitmaps here: They're there, trust me. When I put one on top of the other and scale them down with TextureFilter.Linear I get this: How do I get rid of the dark ...
1
vote
1answer
135 views

LibGDX Box2D Lights - Illuminate background

I have a box2D world made of tiles. I use a custom DirectionalLight for light up the scene from above (It shines through transparent blocks [eg.: the water] more deeply). The problem is (as expected), ...
0
votes
1answer
40 views

LibGDX - how to detect touchUp with GestureListener?

I'm making a game and I have implemented GestureListener as my inputprocessor. It came with a bunch of methods such as fling, pan, tap etc etc including touchDown. However, there is no touchUp method! ...
0
votes
0answers
12 views

Scene2D: Dialog show with animations Sequence is also applied to the Dimming Background

I have issues with the dimmed Stage background when showing a Scene2D Dialog with Action Sequence (animations). The problem is that the animations are also applied to the dimming background and the ...
1
vote
1answer
17 views

Can't give my pictures the right location in libGDX

I have this code here sb.draw(title, (PPlane.WIDTH / 2) - (title.getWidth() / 2), (float) (PPlane.HEIGHT / 10)); sb.draw(playBtn, (PPlane.WIDTH / 2) - (playBtn.getWidth() / 2), PPlane.HEIGHT / 2); ...
0
votes
3answers
347 views

LibGDX how to change animations

I have a Player Class and i have 3 different Animations for it. I can render them perfectly but i don't know how to change from one animation to another. For exmaple i have 3 animations, one for ...
1
vote
1answer
363 views

Lighting shadow casting sprites with box2Dlights

I currently have something like this using box2Dlights Ideally, I would like objects casting shadows to be lit, so the object is lit but there is still a shadow cast around it. Right now the object ...
1
vote
1answer
2k views

Two pass blur shader using libgdx tile map renderer

I am trying to apply the following technique: blur effect using two pass shader to my libgdx game using the OrthogonalTiledMapRenderer. The idea is to blur the background wich is also a tilemap but ...
1
vote
1answer
42 views

LibGDX, Box2D , Destroy body into parts [on hold]

I am developing a game using libGDX game engine and box2d physics engine. There are asteroids in my game, I want to destroy their bodies randomly and fill with texture. How can I do it?