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
62 views

Coordinates issue vertical scroll Libgdx

I'm going crazy with this problem. I'll explain: I have a camera that falls down (flowing along the y-axis) which displays a TiledMap and declare the whole in this way: In the create method: ...
1
vote
0answers
58 views

libGdx Window .pack() not working

I'm trying to make a window, then use the pack method to get the right size, but the window maximizes instead. Here's my code: private Table buildOptionsWindowLayer() { winOptions = new ...
0
votes
1answer
95 views

Combining pathfinding with global AI objectives

I'm making a turn-based strategy game using Java and LibGDX. Now I want to code the AI. I haven't written the AI code yet. I've simply designed it. The AI will have two components, one focused in ...
1
vote
0answers
44 views

LibGDX: Why look BitmapFont pixelated on a scene2d.ui.Dialog?

When I use BitmapFonts directly on the stage table, the fonts looks normal (not pixelated). But when I use the same BitmapFont with the same size on a scene2d.ui.Dialog, the font looks pixelated. ...
0
votes
2answers
62 views

Libgdx, find Vector3 direction

I am using Libgdx along with Bullet physics. I have a vehicle moving. I would like to use a ray from the vehicles origin and in the vehicles forward direction. How can I create the forward Vector3 ...
1
vote
2answers
64 views

LibGDX . draw multiline text

I am trying to write a big text using BitmapFont in libGDX . But it shows on one line and the user can see only the first part of the text . How can I make that bitmapFont made new line automatically ...
1
vote
1answer
103 views

Box2D body rotation with setTransform

I' having a problem rotating a body with setTransform(), The body has multiple sensors that should rotate with the player. The rotation works but it rotates around the bodys local 0,0 position instead ...
2
votes
2answers
82 views

How to increase the acceleration of an object on the Y axis? [duplicate]

So far I am able to make the character fall at a constant rate but I am unsure how to make the character accelerate while falling. When the character is falling I have a line of code as such: ...
1
vote
0answers
34 views

Manage Admob Between Classes [closed]

I have a problem with ads because i want to disable the banner of ads in the game activity. I tried to use this guide https://github.com/libgdx/libgdx/wiki/Admob-in-libgdx#control but application ...
0
votes
0answers
29 views

Parabolic throw with set Height and range (libgdx) [duplicate]

Currently i'm working on a minigame for android where you have a rotating ball in the center of the display which jumps when touched in the direction of his current angle. I'm simply using a gravity ...
1
vote
0answers
87 views

2d libgdx: runtime level generation

I have encountered a problem during my first game development: I thought of a Array<Ground> groundArray that does groundArray.add when a new ground will appear on the screen, and removes oldest ...
1
vote
3answers
192 views

What datastructure would you use for a collision-detection in a tilemap?

Currently I save those blocks in my map that could be colliding with the player in a HashMap (Vector2, Block). So the Vector2 represents the coordinates of the blog. Whenever the player moves I then ...
1
vote
1answer
123 views

Libgdx 2D Game, Random generated World of random size, how to get mouse coordinates?

I'm a noob and English is not my mothertongue, so please bear with me! I'm generating a map for a Sidescroller out of a 2D-array. That is, the array holds different values and I create blocks based ...
0
votes
1answer
37 views

How to initiate a TCP secure connection using LibGdx to a remote server?

Can anyone point to a link or share with me a piece of code which does: - Base on LibGdx (Gdx.net package) - Use a TCP secure connection to connect to a remote server Many thanks
-1
votes
1answer
63 views

LibGDX Json not parsing full file

I'm trying to load a World with different Objects (World Objects and Entities). For that, I want to use Json. For less than two elements this works like a charm. But as I add more elements, some ...
0
votes
0answers
50 views

LibGDX - How to move Actor with fingers Code?

I am completely new to Game Development. I See all these Questions and Answers and Codes and I have no clue what to do with them. I need some Guidance. My Plan: I want my Actor to move up and down, ...
1
vote
1answer
76 views

Does scaling affect performance in OpenGL? [closed]

I've never been able to understand the best practice in this context. I usually want to ship my game with as minimum size as possible. So whereever possible, I try to use scaling of my graphics. Let's ...
0
votes
4answers
113 views

Accurate sprite rotation with mouse movement

I am using the current mouse position to aim the player sprite, but I am not getting the best results. It will often by off by a noticeable amount, or even a complete ~180 off if I go from one side, ...
0
votes
1answer
165 views

How can I create a button with an image in libGDX?

I am new to LibGDX. I am trying to develop a game for Android (so it will support different screen sizes), but I don't know how to put a button with an image. I tried ImageButton but I can't resize ...
0
votes
0answers
40 views

Cannot draw around the screen after zooming out with LibGDX projection coordinate

I've just started developing game in android using LibGDX. I've follow some samples and now my simple game can draw path when user move their finger around the screen. now problems appear when i add ...
0
votes
0answers
35 views

setRotation in touchDrag

I have a problem, have Actors that represent game pieces. What I'm trying to do is make it so the player can click-and-drag the tile to move it around one fixed position in the screen and rotate. I ...
0
votes
1answer
60 views

Swiching screen at collision LIBGDX

I am programming with LIBGDX and I am working with a piece of code. What I want to happen is that when the BUCKET collides with a DROP the game switches screens back to the menuScreen. I have tried ...
1
vote
2answers
70 views

Unable to draw single particle effect at two places

I am using Libgdx ParticleEffect to draw a fire particle effect . The issue I have is that when I try to render a ParticleEffect at two different locations within single game loop, only the last ...
2
votes
1answer
141 views

Is there a difference in these two ways of rendering sprites?

I use an OrthogonalTiledMapRenderer: renderer = new OrthogonalTiledMapRenderer(world.getMap()); and I wonder if there is a differnce between this call: renderer.getSpriteBatch().draw(sprite, ...
0
votes
1answer
86 views

Which input event is suitable for this game?

I am trying to clone this game: http://www.ferryhalim.com/orisinal/g3/bells.htm As i am using libgdx, so the game is both for Android and PC. I was wondering which input event would fit in nicely. ...
0
votes
1answer
24 views

Loading TextureRegion with filter diff from that of texture it came from

I am using libgdx . While packing my texture atlas I have set the filter for mag and min to Nearest . But for just one region I wish to draw it with linear filter . Is it possible to have different ...
0
votes
1answer
52 views

How to check in single event if two objects are clicked at the same time in libGDX?

I am newbie to libGDX and I have written two functions for touchdown, LockerKeyHalfImage.addListener(new InputListener() { public boolean touchDown (InputEvent event, float x, float y, ...
0
votes
1answer
80 views

Rendering tilemaps at a specific position libgdx

I'm making an endless side scroller game like gravity guy with libgdx. To test this I'm just creating two tiled maps with the same .tmx file to render then one after another, like: ...
0
votes
0answers
28 views

Transitive dependencies show up in desktop but not android project

I created a generic library (PB) which I'm referencing in my core project (mega-whack). Here's what the dependencies look like (simplified build.gradle): project(":pb") { dependencies { compile ...
0
votes
1answer
102 views

Making Player Jump

I have been editing a piece of code and I have already implemented gravity so I would like to know how i could make the player jump when the screen is touched. I would like the player bucket to jump. ...
1
vote
1answer
108 views

Make LibGDX game responsive to different phone screen sizes? [duplicate]

I've been experimenting with small games to learn design concepts, LibGDX, and Box2D. I am wondering how you would implement "responsiveness," so to say. For example, this is the rendering part of my ...
0
votes
2answers
158 views

How do I switch between the game screen and score screen without redrawing everything?

I'm working on a multiplayer game in Libgdx and want to display the scores of say, the top 10 players on the map. The player should be able to checking the scores at any point during the game and ...
0
votes
1answer
121 views

Ball bouncing with box2d in libgdx

I just started using Box2d and libgdx. I followed this tutorial, https://github.com/libgdx/libgdx/wiki/Box2d And a ball would bounce if I run the following code I took from the tutorial. // ...omit ...
-1
votes
3answers
95 views

Shooting based off mouse position [duplicate]

I'm trying to shoot bullets where the mouse is aiming using one image as a test. I'm trying to get the mechanics like this I have some kind of algorithm to handle that but the results arn't too ...
0
votes
1answer
47 views

LibGDX ShapeRenderer rotated

I'm having a weird problem with the LibGDX ShapeRenderer where it draws everything rotated. Here are some images to show you what i mean: This is what it looks like in Tiled(Map Editor): This is ...
0
votes
1answer
61 views

Setting bounds to a label in libgdx

textStyle = new LabelStyle(); textStyle.font = font; textStyle.fontColor=Color.GREEN; EnterTextCasheir= new Label("",textStyle); EnterTextCasheir.setBounds(AssetsHelper.convertWidth(158), ...
1
vote
2answers
89 views

Using libraries in libgdx

This is the first time I'm using libgdx and I've got one problem. I am confused by the web of dependencies and the number of projects and I'm not sure how and mostly where to add a third party library ...
0
votes
1answer
72 views

LibGDX ImageButton resizeing

How can I resize ImageButton ? It show very big on screen . How I know it is an Actor and it is not resizing automatically . I can`t find the method for resizing it. Any ideas?
1
vote
1answer
128 views

Timer.schedule(task, 0, 100) never fires

I added some code using java.util.Timer to execute my spawnMonster function every 100ms. It worked, until I tried instantiating images in it -- since it doesn't run on the libGDX core thread, there's ...
0
votes
0answers
63 views

Creating a Wave Motion(ZigZag) on Projectile Motion in LibGDX

Currently im developing a Worms Like game in LibGDX. So i already implemented the firing of projectile and now i want it to move in a Sine Wave Motion while in air. Heres the code of the Bullet that ...
0
votes
1answer
140 views

Sprite draw-order in libgdx

From other frameworks I know methods for easy ordering sprites within a spritebatch (to determine if a sprite has to be drawn in front or behind another sprite). For example in MonoGame/XNA this is ...
0
votes
1answer
62 views

How does super.render() call this method?

Today I was experimenting with adding different screens with Scene2d in libgdx and while doing so I became confused how super.render() in my render() method from my starter class (MyGdxGame) called ...
0
votes
0answers
61 views

How can I scale dialog text in libgdx?

This is what I have and in this case for some reason only the back to menu button is scaled... public class GameOverWindow extends Dialog { private BitmapFontShader bitmapFontShader; ...
2
votes
5answers
190 views

Infinite Jumper Snow Effect

I wish to achieve a snowing effect on my game. The game is made in LibGDX and im using ParticleEmitter. I created a snow effect in ParticleEditor which consists in a line which spawns snow flakes. The ...
1
vote
1answer
121 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
32 views

[LibGdx]Moving a fixture on a body

I'm working with Box2D and I have a basic platform and a box bounces off of it. // Static Platform bdef.position.set(160 / PPM, 120 / PPM); bdef.type = BodyType.StaticBody; Body b = ...
0
votes
0answers
119 views

Gdx.graphics.getDeltaTime(); Returns 0

I am coding a game in Java using Eclipse and Libgdx. I am trying to make an object move until it reaches a certain random point. I am relying on delta time to make the objects speed the same on ...
0
votes
1answer
33 views

LibGDX - Accelerometer Problems

I got some issues. I'm using LibGDX. When I hit an object, my Fighter is supposed to fall to the Ground. BUT, because of the Accelerometer, i can still move it up and down eventhough it died. The ...
3
votes
2answers
298 views

Yet another libGDX resolution independance question

I am developping a Android smartphone game in LibGDX, and I am encountering issues about resolution managing. Most notably, I have no clue how to handle that in LibGDX. For now, I am developping ...
2
votes
2answers
128 views

Implementing Mouse Lasso

I am toying around with a Boogaloopers clone (http://www.youtube.com/watch?v=zuaRi_fhdlQ). I have a small problem with the lassoing. Here's my current naive algorithm. The problem with this is that ...