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

0
votes
0answers
2 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
0answers
5 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
13 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
9 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
117 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
923 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 ...
2
votes
0answers
36 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 ...
1
vote
1answer
503 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
136 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
27 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
33 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
496 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
461 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
375 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
992 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
824 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
366 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
28 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
50 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
52 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
65 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
104 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
24 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
229 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
0answers
30 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
2answers
171 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
131 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
346 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
360 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
39 views

LibGDX, Box2D , Destroy body into parts

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?
0
votes
1answer
66 views

LibGDX - Tilemap Wall Collision Detection Issues

I cribbed some code from another web tutorial (SuperKoalio - https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests/src/com/badlogic/gdx/tests/superkoalio/SuperKoalio.java) about detecting a ...
0
votes
2answers
1k views

libgdx actors and instant actions

I'm having trouble with actors and actions. I have a list of actors, they all have either no action, or 1 sequence action This sequence action has either : a couple of actions (some are instant, ...
2
votes
1answer
829 views

libGDX using Stage and Actor produces different camera angles on desktop and Android Phone

libGDX using Stage and Actor produces different camera angles on desktop and Android Phone. Here are pictures demonstrating the problem: http://brandonyuh.minus.com/mFpdTSgN17VUq On the desktop ...
0
votes
1answer
256 views

Multiplying by delta not giving smooth movement

I started working on my first proper game but reached a problem straight away. In short I have a game that runs most of the time at 60 fps. ( I am using Libgdx a popular Java framework) but my game ...
1
vote
2answers
115 views

LibGDX - Rendering things in different classes

thanks for your time! I'm really new to LibGDX (and Java itself). Which approach should I use to render my different game parts? I want to show a background, the main character, a bunch of enemies ...
0
votes
0answers
14 views

DynamicBody diving into StaticBody

In my game I want a DynamicBody to dive down into a StaticBody. I set up both bodies. At the moment they are colliding. How can I get my DynamicBody to dive down? Is it going to work with this ...
0
votes
0answers
12 views

LibGDX - How can I write my own custom layout (E.g. table layout)

I am currently developing a game and I got to a point where I realised I should use a layout for my screen, as it is going to get messy if I don't (both code and looks wise). Thing is, I do not want ...
0
votes
1answer
17 views

libgdx(android) touchup triggers more than once?

I have a function I run inside the touchUp method but when I click with the mouse during emulation, it triggers my function multiple times. I don't think its an error with the called method itself ...
0
votes
2answers
242 views

get View from LibGDX for Android

I am making a LibGDX app, and I need to get the view to put to an Android app. Here is the code to get the view: package jangkoo.game.shadowfiend.android; import ...
2
votes
2answers
160 views

Why do my Box2D bodies occasionally get stuck and separate forcibly?

I'm making a space game with LibGDX and Box2D. I made a video here to illustrate the issue. Verbal description: When objects collide, they sometimes get stuck together and are then suddenly separated ...
0
votes
1answer
12 views

Polygons and actionlisteners Libgdx

I've been browsing these forums for a while now and I nearly always am able to find an answer without having to ask my own question! Such a great community! This is the first time I've been stumped ...
0
votes
1answer
39 views

Libgdx Admob how to hide ad on specific screen?

I've recently started learning Java for android development. My first game is almost ready to publish in Google Play, but I'm affraid that google might say that on the one screen, the ad may be ...
2
votes
1answer
26 views

Libgdx how to add popup interaction

I am looking for someone to point me in the right direction. I am working in libgdx. I have a game where a player will approach an object on a map and then interact with it. On interaction a new ...
1
vote
0answers
15 views

LibGDX: How to detect remote button press for Android TV?

On Android TV, I need to be able to detect the remote control centre button to start the game. I tried: if (Gdx.input.justTouched() || Gdx.input.isKeyJustPressed(Input.Keys.SPACE) || ...
0
votes
1answer
117 views

Libgdx using Box2d with TiledMap to create collision detection

I'm fairly new to Libgdx and have some good basic knowledge on Java. Right now I am stuck on how to add collision to my TiledMap, I am using the Mapeditor to create the tilemap. I read so many ...