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

How do i detect Line Collison? LIBGDX

I am drawing a continuous line using Pix map. I want to check collision on intersection of my line with the already drawn line.
0
votes
0answers
21 views

rotate to movement direction [duplicate]

If I have a player character that can move 8-directionally, I can set the rotation of the player to face the direction of movement. But if I want to smoothly rotate to a direction, sometimes the ...
2
votes
1answer
51 views

Why do my Box2D collisions fail when I have multiple fixtures on one body?

I'm creating my first libgdx / Box2D game where a player moves around using a mouseJoint. My player has two fixtures, "main" and "question". For some reason when I have these two fixtures, my player ...
1
vote
1answer
32 views

Texture Packer - Any way to make it combine intelligently

I am making a Pokemon Clone, using libgdx. I have the different types of sprites: e.g. Back, front, back shiny, and front shiny. The current way the Texture Packer combines the textures seems to be ...
1
vote
1answer
27 views

How can my entities avoid walking on certain tiles?

In my tile map, created with 'Tiled', I placed some tiles that need to be avoided by my mobiles. Tiles like water or obstacles. The entities "wander" in the map, choosing random directions, and their ...
-1
votes
0answers
17 views

LibGDX/Java - IllegalArgumentException causes my game to crash whenever my main character touches a Coin [on hold]

Trying to figure out why my Android game crashes whenever the player touches an animated coin. I have attached an image of the LogCat and my code is below (NOTE: all game objects in ![Renderer] are in ...
-1
votes
0answers
32 views

LibGDX - Is it worth making a World class for my game? [on hold]

Right now I pretty much have a World class across 3 classes (Player, Game, Renderer) if that makes sense? Game is where game objects are initialised, and Renderer just draws the objects onto the ...
2
votes
1answer
53 views

box2d rendering performance degrading extremely even with sleeping bodies?

I'm working on my first smartphone game, a simple 2D platformer built with libgdx. Game maps use the Tiled level format, so a map is just a bunch of blocks. I recently started using box2d to implement ...
1
vote
0answers
28 views

Libgdx implement 2d drop shadow for transparent sprites

I am a libgdx learner. For an learning application that I am developing using libgdx on android, I need to show drop shadow or glow effect when a sprite is touched. The sprites are created from a ...
1
vote
0answers
36 views

How to eliminate the outline in libgdx?

I'm recently started working on a game in libgdx, and I've run into the problem that my sprites tend to get a thin, whitish outline around them. This is especially a problem for me since I'm working ...
0
votes
2answers
83 views

Optimizing Collision Detection in a 2D Game

I am optimizing my "little" Java (LibGDX) shooter game, and perhaps unsurprisingly, collision detection is a "bottleneck"; I've kind of reached my performance goals already, but I want to tweak the ...
0
votes
1answer
39 views

Dealing with multiple 2d sprite animations for the same object

I am using libGDX for a 2d game. Some of my in-game objects have animations, for example a soldier in top-down view that has a walking animation. That is working fine. Now, while walking, this ...
-1
votes
0answers
13 views

What's the problem with ImmediateModeRenderer20 and ShaderProgram Initialization? [closed]

I tried the code from : https://github.com/mattdesl/lwjgl-basics/wiki/LibGDX-Finger-Swipe and i get those exceptions Exception in thread "LWJGL Application" ...
1
vote
0answers
26 views

Lag when drawing single Texture multiple times in libGDX [closed]

I am building a game where you are basically drawing little dots on the screen with the help of the accelerometer. I am using a single instance of an Actor where I store the coordinates that needs to ...
0
votes
1answer
57 views

Make camera move constantly upwards in box2d world

Im using libGdx to develop a 2d game, which has the following: The world moves in an upward direction by having a camera follow the player's y position. The user only controls player's x movement, ...
0
votes
0answers
21 views

How to draw multiple large background images using libgdx?

I have developed a basic lunar lander-style game using Slick2D and dyn4j and am now redeveloping it using libgx for various reasons. I am having problems drawing the background (i.e. everything, but ...
0
votes
0answers
17 views

AssetManager and Pixmaps

I've been reading about AssetManager here: https://github.com/libgdx/libgdx/wiki/Managing-your-assets. Apparently assets are reference counted (with load and unload). I am wondering about Pixmaps. ...
0
votes
0answers
27 views

How to create Game levels in LIBGDX android game [closed]

Can anybody Guide me. I need to Create Game levels in LIBGDX android game that I have created using kilobolt zombie bird tutorial that is here ...
0
votes
2answers
20 views

libgdx spect ratio not working on android

I have this method: public final float aspectRatioHeight(float originalW, float originalH) { float newHeight = (originalH / originalW) * (Gdx.graphics.getWidth()-20); return newHeight; } To ...
2
votes
2answers
72 views

Entity/Component System - Unique Behaviour

So, I decided to see what the Entity/Component system of game development was all about. I really liked it. So, I decided to implement my current game with it. My problem: Unique Behaviour with the ...
1
vote
2answers
32 views

How can I attach a libGDX actor to a box2D body?

I'm creating game like hill climb racing. I created my car with the help of shapes and joints but I don't know how to attach graphics to it. I used actors and sprites before for the sake of learning, ...
0
votes
0answers
30 views

Seeking Advice: Collision with JBox2d for Top-Down or Isometric Maps

I Hope I can make this as clear as possible! Currently working on an action RPG game, very early stages, more just the basic ideas down and written in. So i'll start on with my setup: Using Java ...
-1
votes
0answers
30 views

Draggable tiled map with locations to klick on (libgdx) [closed]

I'm currently working on a tiled map with tiled. So I want to make it draggable and set positions where the player can click on. Then an event should be triggered. I need some instructions how to do ...
0
votes
1answer
25 views

Libgdx: Android Facebook login with pure java code

I am integrating Facebook with my LIBGDX project and have everything setup (Facebook SDK, generated HashKeys, Facade pattern for platform specific Facebook API's, etc.). The Facebook dev tutorials ...
0
votes
0answers
27 views

libGDX - TextField takes over my multiplexer on android [closed]

I have a simple login page with two TextField widgets and two buttons. If I click on any of the two buttons first everything works as expected, but if I click on any of the two TextFields first none ...
0
votes
0answers
31 views

how to keep timer in android libgdx zobie bird game [closed]

Can anybody help me in remake of zombie bird android LIBGDX game example by Kilobolt, I need to give a time for game play. I have tried giving time through some examples but its not working.
0
votes
1answer
21 views

Libgdx screen keeping text on screen from main Game class

In my libGDX app I have some text running on the main Game class, and when I switch to a different screen the text is still there? Can anyone explain this please. Also in my main class it is changing ...
1
vote
1answer
27 views

LibGDX change screen after 2 seconds

Ive tried using a timer in the render method but that just crashes my game, so how do I change screens after a certain amount of time after rendering.
0
votes
1answer
36 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 ...
0
votes
0answers
16 views

How do I get the impulse of a collision from Box2D in LibGDX?

I am developing a game using LibGDX and Box2D. I want to get the force or the impulse when two bodies collide, but I can't find the right way to do that. How can I use a ContactListener to get the ...
0
votes
1answer
38 views

How do I split a button graphic into a 9 patch?

I understand what a nine patch is but I don't understand how to create one with code. I've made an image with a 1-pixel black border, but how do I turn that into a nine patch? How do I make a nine ...
0
votes
1answer
23 views

Game info file? LibGDX android

In my app I need a file that I can keep settings like: TutorialSkip: True or AppDev: False and other info. How can I make this file and prevent users editing it? This has to work in the Core folder ...
0
votes
0answers
12 views

Box2DLight position seems to Floor

I am creating a top down game and i'm using raycasted lights from Box2Dlights, My light is all set up and working. its attached to the player's Body, and when the player moves, the sprite I attached ...
0
votes
2answers
34 views

Help Understanding libgdx create animations example game

I am trying to understand the example game, cuboc. GitHub is https://github.com/libgdx/libgdx-demo-cuboc. I have generated my texture atlas but I do not understand the code that uses this texture ...
0
votes
3answers
39 views

LibGDX: Making an object move correctly based on real time

Below is an image of my gameworld. As we can see, the player starts at position 0. each cell represents 1 game world unit. My goal is to get the player to move 1 unit (the red cell) in 1 second in ...
1
vote
1answer
36 views

Vertical Text - Bitmap Font Libgdx

How can I achieve this kind of rotation or vertical text using Bitmap Font? I already used Matrix but didn't get the result same as above.
0
votes
2answers
64 views

Placeing stones/tiles on a board game

I am a beginner at libGdx. I am building a board game (the Fanorama game). I would like to use a pic as the board and place the pieces on the board on top of the board sprite. Is there a nice way to ...
1
vote
0answers
19 views

Profiling my LibGDX game [closed]

hello programming friends, I have finished an Alpha version of my LibGDX game but it runs a bit choppy so it's time for me to start getting "analytical" and figure out exactly what's going on behind ...
0
votes
1answer
19 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 ...
0
votes
1answer
26 views

LibGdx Input data in a textfield

I have a textfield using scene2d but don't know how to save user input. this is what i have and it just draws the textfield. txtUsername = new TextField("", mSkin); ...
0
votes
1answer
46 views

Box2D meters and pixels

I am confused about pixels and meters in Box2D. I know that Box2D work only in mters so I need SCALING FACTOR. How big I need it? For example I want that from my mouse coordinates position X and Y for ...
0
votes
1answer
57 views

Removing inline declarations makes code work. Why?

This does not work: camera = new OrthographicCamera(100, 100 * (Gdx.graphics.getHeight() /Gdx.graphics.getWidth())); This does: float w = Gdx.graphics.getWidth(); float h = ...
0
votes
0answers
12 views

Box2D thow ball from PIXELS posisiton

Here are my enemy movement function. I want that my enemy in random Y-position throw a bunch of things in to the player. And I want to implement physics using Box2D. But I know that Box2D workd only ...
1
vote
1answer
59 views

libgdx, how to check collision of randomly generated actors?

I have two groups of randomly generated actors, one is bullets second is enemies. And as of now I have no idea how to check collision of randomly genrated actors and remove the overlaped actors. I'm ...
1
vote
0answers
51 views

How do I fill a shape with a texture in Libgdx?

I am making a 2D racing game. I want to fill the area of the ground object with a texture. I have the shapes of the ground (a Box2D shape). If I make images of the ground with textures, it uses a lot ...
0
votes
1answer
28 views

LibGDX Table.drawDebug deprecated?

I am following the "Learning LibGDX Game Development" book to make a simple game. I am in the menu creation section where we create a stage and render it with debug borders The book says to use ...
0
votes
0answers
53 views

How can I share high scores on Facebook from a desktop libgdx game? [closed]

The Android version of my game can share scores on Facebook. How can I do this on the desktop version? Is Gdx.net.openURI (“http://graph.facebook.com/me/feed”); sufficient?
0
votes
1answer
44 views

Collision detection Libgdx

I'm trying to implement Collision detection using Rectangles for my game but can't seem to get it to work. Bullets are updated when pressing space every frame so they move across the screen. ...
0
votes
0answers
34 views

LibGdx Exception

Here is the exception: Exception in thread "LWJGL Application" java.lang.NullPointerException at com.mygdx.test.excav.game.WorldRender.renderTest(WorldRender.java:34) at ...
0
votes
0answers
23 views

Libgdx Scene2d shows White screen when executed

package com.Darth377Apps.DeepShadow; import com.badlogic.gdx.*; import com.badlogic.gdx.graphics.g2d.*; import com.badlogic.gdx.scenes.scene2d.*; import com.badlogic.gdx.scenes.scene2d.ui.*; import ...