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

-2
votes
1answer
133 views

How do I make a button that can only be pressed once / you can't hold it [duplicate]

I've created a button by checking if the left mouse button is being pressed and the cursor x/y are in the boundaries of the button but the issue is that if you even hold it down for longer than a ...
0
votes
0answers
104 views

libGDX TileMapRenderer not doing anything

I was using this tutorial and tried to make the TileMapRenderer work, but I can't. It never renders anything, no matter what i do. EDIT: I found out that the problem has nothing to do with the code. ...
6
votes
1answer
1k views

How can I achieve smooth shading / glow from one tile to another?

I've been working on a tile-based game in which some areas may be lit (currently seen), some may be black (never seen) and some may be dark (previously seen, but not currently seen). Looking at the ...
0
votes
1answer
200 views

questions about position and size

I am new to game development and I wanted to ask a question. I am reading the simple game example from here. 1) I want to ask why we define bucket.x = 800 / 2 - 48 / 2 ? How is that? Why not just ...
1
vote
1answer
293 views

Dealing with “jumping” sprites: badly centered?

Thing is, I've used darkFunction Editor as a way to get all the spriteCoordinates off a spriteSheet for each individual sprite, and parse the .xml it generates inside my game. It all works fine, ...
1
vote
1answer
82 views

Black areas on different screen sizes

I'm currently facing some problems with sprites/images on different screen sizes. For now the game stage is stretched to maximum width and height of the screen. In Samsung Galaxy S2, SGS3 and SGS4 ...
0
votes
1answer
1k views

libgdx keyboard input

I'm trying to figure it out how to check if keyboard key was released. I tried messing around with InputMultiplexer, InputProcessor, etc. Nothing helped. Not enough documentation from lib developers ...
2
votes
1answer
750 views

libgdx collision/picking

I am trying to make something with java libgdx (2D). One thing that I can't figure it out is how to check mouse intersection with (fore example) isometric textures that are not rectangle shaped ...
4
votes
2answers
372 views

2.5d with box2d - approaches from the top and bottom

So, I'm using box2d for my 2.5d game (think double dragon, tmnt arcade, castle crashers) where you can move around on the z-axis (faked as y-axis movement). Basically, I have box2d only doing ...
-3
votes
1answer
221 views

How does the Goomba know it has been jumped on?

I'm developing a 2D tile game engine in LibGDX and I'm asking myself how to structure the whole thing. One of the key questions right now is how to implement Player-Tile interaction similar to this ...
0
votes
2answers
1k views

What is the better way of generating levels in android game using LibGDX

I downloaded the source code of metagun for android from https://github.com/libgdx/libgdx/tree/master/demos/metagun/metagun-android The game uses a png image to create the level. It uses the ...
-1
votes
1answer
122 views

Android TCG structural design [closed]

I started developing tcg for android, using ADT bundle. What is the right approach/way for making/storing cards/game info, local sqlite, some kind of data file? some service? or something else?
1
vote
1answer
233 views

How can I implement an asset update/download in a libgdx application?

I am building a game based on libGdx and I want to be able to check for and download updated assets at some point before the player starts playing. The game is being built for PC and for Android. I ...
0
votes
1answer
165 views

Problem with Widget Event Reporting in Libgdx

So I'm trying to test an ImageButton on an Android device. I can get the button to appear on the screen, but when I press it nothing happens or appears on the log. Here is what I have in the Show() ...
4
votes
1answer
2k views

Confusion with Libgdx UI

I've started with Libgdx and am currently stumbling about trying to understand how to set up the interface. I have generated the base projects in Eclipse ( < proj-name >,< proj-name >-android, ...
2
votes
1answer
3k views

How do you implement Libgdx touchDragged?

I'm a beginner in Java and in Game Development too. I was following some tutorials, but now I'm stuck on implementing a touchDragged listener using libgdx, Can anyone suggest how to drag the image ...
-1
votes
1answer
192 views

Get distance between the edge of screen and a moving sprite

How to get the distance between the edge of the screen and a vector moving sprite? I want to get the distance between my moving sprite and the edge of the screen so that when my sprite touches the ...
1
vote
2answers
661 views

LibGDX GestureDetector touchUp

I am using to GestureDetector to detect drag gesture and determine vector based on position my finger first touched the screen and position when my finger left the screen. I already know that I can ...
1
vote
1answer
1k views

Drawing in 3D with LibGDX

Is there any way to simply draw in 3D, just like you would draw with ShapeRenderer or SpriteBatch? All I want is to draw circles that are in x.y.z coordinates, so some circles are far away from view ...
0
votes
1answer
828 views

Creating metadata/pack files for an existing sprite sheet

I've just bought Oryx's tileset pack: http://oryxdesignlab.com/sprites/ultimate-roguelike-tileset I use LibGDX (flixel-gdx to be precise). My question is, given this premade sprite sheet format, ...
1
vote
1answer
2k views

LibGdx : Animations not working on custom actor

I have this code for rendering a sprite, retrieved from a TextureAtlas public class SpriteActor extends Actor { private Sprite sprite; public SpriteActor(TextureAtlas atlas, String spriteName) { ...
1
vote
1answer
348 views

sharing preferences between two apps on android with libgdx

I am making an android game with both a demo version and a paid version. I want users who decide to buy the paid version to continue from where they left off, with all their old data and settings. ...
1
vote
1answer
622 views

LibGDX Cross Platform Networking

Backstory: I've been developing a game with LibGDX for the past two years, and I've seen it refactored more times than I remember. I jumped on the iOS iKVM port as soon as it was released. But I've ...
1
vote
1answer
189 views

How to attach one sprite to another in LibGDX?

I want to attach one sprite to another so that it is always located at the 'bottom' of the other sprite, regardless of how the main sprite is rotated.
0
votes
1answer
586 views

Deploying GWT application / LibGDX and TextureAtlas problem

I encountered with a little problem. After GWT (and LibGDX) deployment I got an error: GwtApplication: exception: Couldn't load image '/images/objects.png', file does not exist Couldn't load ...
4
votes
1answer
2k views

Libgdx sprite rotation (image quality)

This one is probably really simple but I didn't find a solution. I'm trying to create a widget (speedometer) with libgdx. For the arrows I'm using the setRotation() function. But when the image is ...
1
vote
1answer
183 views

LibGdx: How do I combine 2 GestureListener objects from 2 seperate classes into 1 GestureDetector

I'm trying to make 2 separate classes, 1 a VirtualJoystick class and 1 a VirtualButton class. I want to implement a GestureListener class in each, it just seems like good code to do so, but when I go ...
0
votes
2answers
228 views

Vector2 always starts from origin

I am trying to create Vector2 which starts from the players sprite and points towards other point. And I need its starting point to move along with player sprite. But however whatever I do all my ...
-2
votes
2answers
3k views

touchDragged how to move a sprite [closed]

I have 1 simple sprite on the screen and I'd like to move it with the finger. (not necessarily by putting the finger on it, just anywhere on the screen) I built the project using gdx-setup-ui.jar ...
0
votes
0answers
233 views

fire multiple events in InputListener

I have two Actors on my stage in libgdx and and both have a InputListener. I override the touchDown method and it works fine. My Problem is that when I press my Actor Z and a second later Actor Y only ...
0
votes
1answer
219 views

Stereo music playing in mono in libGDX

I'm trying to get some music to play back in stereo in libGDX, but it seems to be blending the left and right channels so much that it sounds like it was mono. To test this out I made a sound file ...
1
vote
2answers
896 views

How to I rotate a triangle by dragging the mouse in libGDX?

More specifically, I have rotation working in a way I don't like as follows: //Draw the triangle using this draw method //batch.draw(texture, x, y, ...
0
votes
1answer
2k views

perspective camera with libgdx

I am trying to setup a viewport using perspective camera. I am trying to render a scene like this I read an official blog post about the cameras and found a few tests within gdx test suits. ...
2
votes
1answer
179 views

Camera not strafing (GLSL)

I use this code in my GLSL vertex shader, where v_position is the vertex position: gl_Position = v_position * u_camera; and set u_camera as follows: meshShader.setUniformMatrix("u_camera", ...
0
votes
1answer
782 views

Dependency setup between libGDX projects in Eclipse IDE

For my game I'd like to create another project that extends the functionality of libGDX and since it will be an independent project it could be easily reusable. How can I achieve this in Eclipse IDE? ...
4
votes
1answer
1k views

How To Correctly Extend the Sprite Class in LibGDX

I am currently pursuing game development as a hobby, and have run into what seems to be a conflict in my mind regarding how to properly (using best practices) extend the Sprite class in LibGDX (or for ...
1
vote
1answer
370 views

Tiled map seen from an angle

I have working code to display a tiled map. It's composed of a OrthogonalTiledMapRenderer and an OrthoGraphicCamera : camera.setToOrtho(false, WORLD_WINDOW_SIZE.x, WORLD_WINDOW_SIZE.y); ...
0
votes
3answers
2k views

Implementing a basic jump in libgdx

I have seen the document for libgdx and managed to move the character and also to implement bounds but the document does not show how to implement jumping. I have downloaded the superjumper demo code ...
1
vote
2answers
151 views

Moving Sprite With Physics Frame

Normally, a physics frame in pink (see image below) gives the body for detecting hit signal. It usually either falls down or lifts up depending on the gravity orientation. The question is: Is it ...
5
votes
2answers
834 views

Is it legal to pack LibGdx libraries in my jar file? And to obfuscate them?

I'm using LibGDX and deploying a runnable jar file, using the Eclipse feature, with libraries extracted into it. There are also .so files and .dlls inside. 1 . Is it legal to do so? I didn't find ...
1
vote
1answer
2k views

How to render a tilemap efficiently? [duplicate]

I'm using this code to load a tiled map, composed of 1000x1000 32x32px tiles: map = new TmxMapLoader().load("levels/xyz.tmx"); camera = new OrthographicCamera(); camera.setToOrtho(false, ...
-2
votes
1answer
246 views

How do I make a ship fire shots?

I am making a Galaga-like game. How can I make the ship fire gunshots? What logic do I need to make it work? I am using libgdx to develop the game. I have gotten the ship and an enemy on stage, ...
2
votes
2answers
2k views

Common practice when handling sprite animation

Let's say I'm using the following sprite as a sample to try LibGDX Animation and TextureRegion. http://www.smackjeeves.com/images/uploaded/comics/7/8/78bc6b62fEySW.gif As you can see, the provided ...
0
votes
3answers
348 views

How can SpriteBatch use a single texture/asset as multiple independent objects/instances

I'm using LibGDX to create a game, but I'm encountering a problem with SpriteBatch. Whenever two objects that use the same image for their sprite come onto the screen, the new object replaces the old ...
2
votes
1answer
641 views

Libgdx import bin/xml/json from physics editor

I'm using Libgdx. I did a simple json file in Physics Body Editor and I don't have any idea how could I import it into my physic world in libgdx. Any idea will be appreciated. P.S: Sorry if there ...
4
votes
2answers
283 views

Creating stable tentacle structures

I am using verlet integration to simulate some tentacles. So far it works great and I am satisfied with how it looks in general. Here is how a tentacle is built: The very stiff sticks are colored ...
0
votes
1answer
120 views

Merging InputProcessor and GestureDetector

I'm planning to make a simple soccerball app. When I attempt to drag the ball, I use the touchDragged() from InputProcessor to move the ball left or right. Next, while holding before releasing, I use ...
1
vote
1answer
2k views

How to implement bullet physics in libgdx

I am new at game development want to know that how can I implement bullet physics in libgdx. I searched lot of things on Internet but nothing found worthy.
3
votes
3answers
399 views

Libgdx body passing through block then fall on it

I'm using libgdx and its physic engine Box2d. My question is : how could I make my box2d body go through a block , ignore the first collison than make the block active so the ball can fall onto it. A ...
3
votes
1answer
221 views

Cut a translucent square in a texture

How to remove (cut-out) a transparent rectangle in a Texture, so that the hole will be translucent. On Android I would use the Xfermodes approach: ...