Tagged Questions

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
votes
1answer
833 views

libgdx intersection problem between rectangle and circle

My collision detection in libgdx is somehow buggy. player.png is 20*80px and ball.png 25*25px. Code: @Override public void create() { // ... batch = new SpriteBatch(); playerTex = ...
3
votes
1answer
340 views

Why is SpriteBatch.end() generating null pointer exception in this code?

I am getting a null pointer exception using libGDX that the debugger points as the SpriteBatch.end() line. I was wondering what would cause this. Here is the offending code block, specifically the ...
0
votes
1answer
974 views

coloring box2d body in LibGDX

I want to color polygon of box2d in LibGDX. Found below useful class for that. http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/glutils/ShapeRenderer.html But, it is not ...
1
vote
1answer
80 views

All libGDX input statements are returning TRUE at once

I'm fooling around with Box2D and libGDX and running into a peculiar problem with polling for input. Here's the code for the Screen's render() loop: @Override public void render(float delta) { ...
1
vote
1answer
335 views

Why doesn't RGB565 lead to a smaller memory footprint on Android?

I'm using LibGDX for my game. I'm loading 9 bitmaps into memory at once using the AssetManager, about 512x512 pixels each on average. TextureParameter texParam = new TextureParameter(); ...
0
votes
1answer
455 views

Using native code with Libgdx, (Raknet)

I was searching for a game engine (Java- maybe C#) with built-in real time networking library to develop 2D cross platform (Android - iOS) multiplayer game. Actually I have not found well suited ...
2
votes
2answers
2k views

Libgdx OrthogonalTiledMapRenderer not rendering map properly

I'm using a little hack to change the coordinate system to the one i'm accustomed to (left and up is negative and right and down is positive) but this causes the tiled map renderer to render the map ...
0
votes
2answers
607 views

Libgdx InputListenner not working

I've added an InputListener to my libgdx actor and I've added the actor to the stage. The stage (and all of its actors) gets drawn just fine. The problem is my actor doesn't seem to be receiving ...
2
votes
0answers
119 views

Unproject considering parallax depth

How can I take screen coordinates (or alternatively world coordinates on the 'primary' parallax plane) and find out what world coordinates they translate into when taking parallax depth into account? ...
3
votes
1answer
654 views

box2d raycast filter category

I am trying to filter a category in my ray casting (jBox2D within libGDX), which should return the closest object that does not belong to the category LEVEL0. I've tried a plethora of approaches, but ...
0
votes
0answers
125 views

Rendering tile maps for mobile devices

Hitting a bit of a roadblock with my game's development and I'm just looking for some outside advice. I'm trying to render a tilemap for my mobile game (Android) and I'm using LibGDX. Now, here's ...
5
votes
1answer
570 views

OpenGL ES 2.0 obscured texture is visible

Hi, I am using LibGDX and OpenGL 2.0 to create a game. So far I have created two meshes. The front mesh is the one with the brown circle texture and another mesh on the top with a green to white ...
4
votes
2answers
1k views

LibGDX stretching 2d graphics

I have a problem with stretching sprites in LibGDX. I have one png file for the sky in the game (1 x 1000px) and I want to render it 1000 x 1000px sprite.setSize(pixelWidth,pixelHeight); I want to ...
0
votes
2answers
2k views

Detecting key press only once in Libgdx [duplicate]

Have a question on keyboard inputs. Currently I am using this method to read my input, Gdx.input.isKeyPressed(Input.Keys.A), it is working fine. But I do realized at times there are multiple instances ...
0
votes
1answer
423 views

How can I get animated bone's transformation in LibGDX?

I am trying to get transformation from a bone, but i can't, I exported just a animated armature with just a bone from blender, then I converted to .g3dj, so I just need the bone transformations so ...
0
votes
1answer
278 views

Remove a body when touched in LibGDX(Box2D)

I am using LibGDX to create a new project. What i am trying to do is, i load bodies from a tmx file into levels which works fine. The bodies also has a sprite with them. The problem is, is i would ...
1
vote
2answers
298 views

When input listener set in resize(), input doubles

I created a button and assigned an input listener in the resize() method of the screen. For simplicity's sake, whenever I press the button, 1000 adds to a total amount. The weird part is, it adds ...
1
vote
0answers
111 views

LibGDX drawing portion of tmx map

I am trying to make a tile based game in LibGDX and I have run into some problem. In earlier versions of LibGDX you were able to draw a certain section of a .tmx map instead of a whole and even a ...
4
votes
0answers
538 views

Advice on NPC architecture [closed]

I'm developing a 2D Zelda game with LibGDX in Java using TileD maps. I am now adding NPCs to the engine and I'm thinking about how to make them so it's going to be easy for me to add/edit their custom ...
0
votes
1answer
72 views

libgdx fixture is giving unresponsive error

need some support. I am novice in libgdx game engine. Below is my code package com.game.box2d.fruitcart; import com.badlogic.gdx.Game; import com.badlogic.gdx.Gdx; import ...
0
votes
1answer
700 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, ...
1
vote
1answer
612 views

rendering transparent meshes in LibGDX

Building open this tutorial - https://code.google.com/p/libgdx/wiki/ProjectionViewportCamera I have constructed a class for generating polygon meshes. But i cannot figure out how to render semi ...
2
votes
2answers
625 views

How to implement pathfinding in this situation

So I'm creating a game for android using the libgdx library. I render the map from a tmx file and in it all the water tiles have the property of blocked. My player(a sprite) moves to where I ...
1
vote
1answer
938 views

Moving bounding box in 3D using Libgdx

How do i go about moving a bounding box in libgdx? I want to make the bounding box capture my character and move with him. So ideally i want to be able to copy my vector 3 from my model instance and ...
-1
votes
1answer
542 views

Different Attack Systems in RPG [duplicate]

I'm making a 2d rpg game with libgdx and java, and I'm wondering how I would organize different attack systems - magic, melee, etc. (it's not a turn-based rpg). I have a PlayerClass enum, a Player2D ...
6
votes
0answers
312 views

Box2D strange collisions (jitter) on sharp edges [closed]

I'm currently developing 2D side scroll game with Libgdx + Box2D. And I'm facing some problems with ChainShape (the ground) and PolygonShape (the cart body) collisions. Please look at this video: ...
0
votes
0answers
265 views

Box2D revoluteJoint Motor speed,Max torque scaling for diff Devices

Hi i am using Box2d Revolute Joint as a joint for wheel it's connect to Wheel and Body of my Car i am using RUBE for creating the Box2D world Prob. i am using a scaling floating point number to scale ...
2
votes
2answers
1k views

how to design and develop game level(stages) [closed]

I need some expert opinion about game level design. I've been developing android game(2D) using LibGDX framework inspired from below sample game. LibGDX sample Drop game I've customized this game ...
2
votes
1answer
515 views

LibGDX Scene2D event handling and bounding box relative to the center of a TextureRegion

I'm experimenting with Scene2D to see if it fits fot the game I want to develop. Say I have an Actor with the origin in the center of its TextureRegion. My setup method contains this code: float ...
2
votes
1answer
3k views

Libgdx explain steps for beginner to create and use image as a box2d body [closed]

I am basically from corona background and new to LibGdx , familiar with stage and actor from scene2D. Now wants to use physics body from box2d in the game besides using actor from scene2D. But I ...
0
votes
1answer
716 views

Movement with box2d using libgdx

I am pretty new to using physics engine and would like to know what is best practice for movement of playercharacters. Currently I have a class called Hero that has a CircleShape and when the user ...
0
votes
0answers
30 views

Trouble loading .png file using LibGDX [duplicate]

I'm trying to load a Texture to libGDX and I'm getting a file not found exception. Here's the code that's trying to load the .png file. ` //Textures private Texture tiles; private TextureRegion ...
1
vote
1answer
2k views

LibGDX Drawing sprites when moving orthographic camera

I've been having this problem for a long time and I just can't seem to find the exact problem. I have a game where the map is 480x1600 and my camera has a view of 480x800. I have a button that when ...
1
vote
1answer
109 views

How do I use warble to package libgdx and ruby?

My ruby code is as follows include Java Dir[File.expand_path "#{File.dirname(__FILE__)}/../libs/\*.jar"].each { |x| require x; puts "go"} module LibGDX include_package "com.badlogic.gdx" ...
1
vote
1answer
444 views

ParticleEffectPool.obtain() not resetting particles

I want to use ParticleEffectPools in libGDX but I'm running into an odd issue where the effects don't seem to be reset when obtained by the pool. The code below looks for an existing ...
3
votes
1answer
2k views

Libgdx , how to get mouse position relative to a Tiled Map

I'm porting a game that i did for Ludum Dare 26, this year, i made it using Contruct2, i decided to port it to Libgdx, for learning reasons, ...
2
votes
0answers
366 views

Choosing a level editor of a 2d platformer [closed]

I'm working with a small team on a 2D platformer game in Java (LibGDX) that uses Box2D for physics. Our team is looking for a tool to make the levels (that we will be able to integrate with the Box2D ...
0
votes
1answer
1k views

Side Menu using Libgdx

I want to make it so that when the player presses start, a side menu slides out and gives a player some option on one side of the screen, similar to Angry Birds or Pokemon. I'm not sure how to go ...
0
votes
1answer
269 views

Tweening in 2d side-scrolling RPG

I'm working on a 2d side-scrolling RPG-ish game. Currently the movement of the main character(hero) is based on the A and D keys, because it's 2d and I don't really care about jumping. I would like to ...
1
vote
1answer
3k views

Registering InputListener in libGDX

I'm just getting started with libGDX and have run into a snag registering an InputListener for a button. I've gone through many examples and this code appears correct to me but the associated callback ...
0
votes
1answer
296 views

Design question: How to handle input more efficiently?

I'm designing a system to handle the keyboard input for my game. To get it more simple, I have a class that has two methods, KeyUp and KeyDown which tell me which key has been pressed, this is already ...
1
vote
0answers
83 views

How to space actors in scene uniformly? [duplicate]

I have a Array data structure right now, which contains 10 soldiers in my army. They can setup initially in various formations - e.g. o o o o o o o o o o The user can move one of the ...
-2
votes
3answers
277 views

ArrayList mixing up indexes?

Working title. I'm warming up to libgdx and I'm trying to remove objects from an ArrayList when pressed/touched. The Objects are rectangles and about 70% of them get removed, the other 30% just stays ...
0
votes
1answer
229 views

swipe effect problem using only mesh and array - libgdx

I tried to combine matdesl's and libgdx's draw lines algo ang code. but i can only create a line. problem is i want to make a fruit ninja swipe effect but only knows this... problem is i want to make ...
2
votes
0answers
280 views

How to create heat haze effect in Libgdx?

I would like to create a heat haze effect for a 2D game I am making. Do You have ideas or suggestions, how to get that effect. I am using Libgdx(OpenGL 2.0). Thank You in advance!
2
votes
1answer
2k views

Libgdx loading images

I can't find a sulotions that solves my problem, I've tried pretty much every tip I can find, but with no luck. Error : Exception in thread "LWJGL Application" ...
0
votes
0answers
402 views

pause or freezing game screen

I have a question regarding the pausing/freezing a game while a window/pausemenu will appear at center of the screen. I've already created a pausescreen class which will be called each time the back ...
1
vote
0answers
320 views

Libgdx: scrolling background for preview screen

Good day, I have been coding for quite a while now and I'm at an certain point where i am having difficulties on solving something. I've been creating a preview screen which contains the following: ...
1
vote
1answer
1k views

libgdx: how to manage entity classes [closed]

Good day sirs, I know this is a newbie question but I really need to ask it. I've been reading a lot of sample codes on libgdx, and I have seen entities(player, enemy, boss,etc.). my question is what ...
0
votes
1answer
819 views

Error using Physics Body Editor for LibGDX

In my game, I've been trying to use the physics body editor for libgdx, but I kept on getting an error. So I thought there was probably something wrong with my code so I took the example off of the ...