Questions tagged [libgdx]

LibGDX is a cross-platform Java game development framework based on OpenGL (ES) that works on Windows, Linux, Mac OS X, Android, iOS and your WebGL enabled browser.

Filter by
Sorted by
Tagged with
0
votes
1answer
18 views

Libgdx, button onclick event crashes

I'm trying to create an android game using libgdx with a Titlescreen, you just press start and your game startes. However I'm having difficulty trying to get these buttons to work. The titlescreen ...
0
votes
1answer
35 views

Json Libgdx serialize / de-serialize a Object Map of Object Maps

Any one have any ideas on how I can serialize / de-serialize an ObjectMap<Enum, ObjectMap<String, Object>>(); (Object is usually a String Integer ...
0
votes
0answers
24 views

Character shakes when using raycast avoidance (libgdx)

https://github.com/libgdx/gdx-ai/blob/master/tests/src/com/badlogic/gdx/ai/tests/steer/box2d/tests/Box2dRaycastObstacleAvoidanceTest.java Literally, I copied the core avoidance code. But substituted ...
0
votes
0answers
18 views

How to handling touchpad?

I have a touchpad. I tried touchpad.getKnobX> 0 and <0 (when swiping the knob left and right) the sprite still displayed but when I put touchpad.getKnobY> 0 and <0 (to swipe knob up and down) ...
0
votes
0answers
61 views

How do I make a hitbox for a sword in a top-down game?

Context: I'm using Box2D through LibGDX in Java. The sword and the player are in separate classes. Both extend LibGDX's Sprite class. I've got a sword attached to my character that swings when I ...
0
votes
0answers
20 views

LibGDX Box2D, how to play an animation once, then set the state back

So, I've got some animations in LibGDX that I want to get running. Currently, the walking animations work perfectly, but attacking doesn't. I want the attack animation to play once, then set the State ...
0
votes
1answer
27 views

Alternative path not working

I am using Android studio (libGDX), and I can't figure out why alternative paths doesn't work. I've tried it as it said in the book, but it doesn't do anything, it shows a black window and than the ...
0
votes
0answers
21 views

Setting the position of a Rectangle does not always work in libgdx

I'm experimenting a little with libgdx and I'm trying to use it to create a little android game. Everything goes well until I try to correct the player position when a collision occurs. This is the ...
0
votes
1answer
31 views

testPoint not working - libgdx

I'm making a game like angry birds with LibGDX and box2d in which I want to drag a ball (instead of the bird) back before releasing it. I deploy with testPoint function: when I touch down the ...
0
votes
0answers
24 views

Libgdx Recoil Effect

I set -velocityX to my sprite gun. float velocityX = -20 * dt; if(trigger) { gun.setX(gun.getX() + velocityX); } I basically set a velocity of -20m/s to my ...
0
votes
0answers
25 views

Parallax effect jitter in libGDX

Basically I'm using this ParallaxCamera class to create the effect in my game, but upon movement, the layers "wiggle". This is especially noticeable when the camera is moving slowly. I have fixed the ...
0
votes
0answers
60 views

How to sync entities in an ECS game?

I'm wondering how to engineer a client server sync of entities in a multiplayer game which is using an ECS. When the server changes some values of the components of an entity, I thought the best ...
0
votes
1answer
39 views

Render a sphere when the user clicks on the screen with libgdx

I’m really new to Libgdx, and decided to try out some codes to familiarise myself with it. I’m trying to write a program such that a sphere is rendered at the position of the user’s click. Here’s my ...
1
vote
0answers
51 views

Why is my player falling through the Tiled map?

I am gassed. I have this game due very very soon. I made my player so that it doesn't fall through or go through tiles from Tiled that have the property "blocked". I do not know why but it is not ...
0
votes
0answers
41 views

Create Scoreboard using LibGDX table layout

I am trying to create a card game, which will contain following features. It will be a 6 player game. Each player contain set of cards, where each card contain some specific value After every round a ...
0
votes
0answers
17 views

How to damp the velocity of an object only in one axis in Box2d?

I want to damp the velocity of a ball linearly on the x-axis. but when applying linear damping on the ball, the damping also applies in the y-axis which makes it look like its floating. I tried to ...
0
votes
0answers
17 views

LibGDX How to use Viewport correctly?

guys! I divided the screen into two parts using Viewport and now the game does not work correctly. The control buttons do not work all. If you click in some part of the screen (not on the control) -...
1
vote
0answers
31 views

What would be the best way to let Box2D handle collision on different (simulated) heights?

I'm working on a 2D top-down game but we are also using a Z coordinate. This is to simulate the effect of 3D/height. Now the player can walk under a bridge and also over a bridge. The next thing I did ...
0
votes
0answers
12 views

Networking roundtrip performance optimizations

I‘m creating a multiplayer game with libGDX and KryoNet for the networking part (I also uses Ashley as an Entity Component System, but this doesn‘t necessarily matters here). The communication between ...
1
vote
0answers
19 views

LibGDX: Scene2D Stage wont react on multiplexer input

I've got an inputMultiplexer. I want to register about two or three "systems" as processors. The classes which implementing InputProcessor get registerd by me like ...
0
votes
1answer
21 views

LibGDX “EXCEPTION_ACCESS_VIOLATION” error when recreating previously disposed Box2DLights light

I just installed the Box2DLights dependency for LibGDX and I added a cave with 2 ConeLights inside. The first time I render the cave, everything works as expected. Then when I exit the cave, I make ...
0
votes
0answers
13 views

Different sized textures on texture atlas in Libgdx

I've created a texture atlas with TexturePacker. All of the single textures have the same size. The textures have large areas of transparent pixels which TexturePacker can remove. But when I import ...
0
votes
0answers
15 views

Spritebatch clears screen white

I have 2 actors one is drawing a table one is drawing with spriteBatch. They both drawing well if they are seperately added to the stage. Adding both to the stage ends up with a white full screen ...
0
votes
0answers
13 views

Howto setup screen with cameras and viewport to achieve splitscreen as specified (LIBGDX)

I played around with cameras and viewports, but all my settings had no effect. Also read several topics about this, but still don't understand the concept. What I want to achieve is what I show on ...
1
vote
1answer
91 views

Is it a good idea to implement a MVC pattern into my LibGDX 2D RPG-style game?

For example I currently have a Player object that contains it's textures/animations and how to render these (I'd consider this as the view). Player also has an update() method which controls where the ...
0
votes
0answers
11 views

Howto use orthographicCamera with actors with shaperenderer (libgdx)

I have a simple actor, which draws a circle. I have a orthographicCamera now I want simply translate the camera, so that the circle moves without changing the coordinates of the circle. I can't ...
0
votes
0answers
18 views

How to sync Box2D worlds with an dedicated server?

My game consist of two parts: The client and the server. At first the game was planed as single player. After a few month I decided to implement it as an multiplayer game so I started a new sub-...
1
vote
3answers
133 views

LibGDX - Draw rectangular shapes

I'm making a 2d game in which units occupy a dynamic area of the map. This area will be a rectangular shape like in the following picture. The exact shape will change during gameplay. How should I ...
0
votes
0answers
44 views

Android libgdx java

Question1:Bird collaide with Coin that time coin is dissapear working but shudenlly apeared.What do to?.android java libgdx for(int i = 0; i< coins.size; i++){ Coin coin = coins....
0
votes
1answer
48 views

Rotating Sprite Around A Point Without Messing Its Drawing Point

I am trying to draw and rotate an arrow sprite based on a point,around a static circle body without messing its drawing starting point. Arrow should be directed to the same direction with user touch ...
0
votes
0answers
62 views

LibGDX Android Choosing Viewport Stretching Problem and Aspect Ratio

I am trying to find a viewport for my android game so that it will look okay across different devices and i wont use pixels anymore(i use artificial world coords). I read the viki and watched some ...
0
votes
0answers
58 views

Why aren't my libGDX config.x and config.y centering the window on my screen?

My window always shows up in the bottom... near right side. DesktopLauncher : ...
3
votes
1answer
148 views

Mob generation design - is creating a class for each mob efficient?

I'm working on an RPG game for my coursework project. Everything is going fine but I've reached a stage where I do think that my project's code is not the most efficient. Here I have a constructor of ...
0
votes
0answers
13 views

How to load Preference file in Libgdx asynchronously using Asset manager?

The Preference and AssetManager documentations don't mention this.
0
votes
0answers
31 views

What to send for moving players in a networking-game

In my game I make use of Ashley (the Entity-Component-System). I've got a player which have an Transform-Component as well as a Brain-Component which is holding the boolean variables which are ...
0
votes
0answers
23 views

can't achieve a smooth movement with ShapeRender

I am using ShapeRender to render Circles and in the update function on every loop I update the coordinates that represent my ...
0
votes
0answers
111 views

Map generation for a 2.5D RTS Game

I've been looking on the net since some time for generating a map for my isometric RTS game. The map should have biomes, humidity, wind directions and etc. But I couldn't find a correct algorithm or ...
0
votes
0answers
44 views

Server Side Simulation Synchronization with Client Box2d

I am running a simple box2d simulation on nodejs server.(planck.js) 2 bodies are connected to each other with distance joint and one is orbiting around another. I also have a java libgdx client with ...
0
votes
0answers
93 views

How can I get a straight path using A*?

How to change A* work so that the path is more like a straight Euclidean distance? I read that you need to break some nodes, but how to implement this? I need heuristic like this: Is such a ...
1
vote
1answer
82 views

How to convert a FBX made by blender 2.8 in to a `g3db/g3dj` file?

I've tried to convert a simple cube with libGDX FBX-Converter but the cube is't displaying in my game app. The FBX file is created by blender 2.8 This is the g3dj file ...
1
vote
1answer
23 views

Libgdx fbx converter doesn't write meshes to g3dj file

LibGDX FBX converter doesn't write meshes nor materials to g3dj file. This happens with blender 2.8 when exporting model to FBX then converting it to ...
0
votes
1answer
35 views

Flat shaded triangles using the ModelBuilder?

I decided to give the ModelBuilder a try but I cannot get rid of the smoothing of my terrain. So what I tried: Create each triangle individually with there own ...
0
votes
0answers
36 views

Libgdx change velocity of moveTo action

I am trying to create physics for a ball in Libgdx. The ball starts moving after a pan and everytime the ball collides with a wall, a moveTo action is added to it. But my ball moves with a constant ...
0
votes
0answers
20 views

Make perspective camera X positive values to the right

Is it possible to make the positive values of the PerspectiveCamera to the right? By default is to the left
1
vote
0answers
159 views

How to make a top down 2D ball rolling

I am developing a top down game similar to 8 pool billard with libgdx and box2d. How do i make a 2d ball texture look like its rolling when force is applied like this: So it feels actually 3d ? For ...
0
votes
0answers
27 views

Get json response in libgdx

I am trying to get json response in libgdx. Here is my libgdx code. ...
0
votes
0answers
17 views

how to create button to change screen

i have a problem with my code. When I add a button to change the screen, a crash occurs or takes a long time to convert to the other screen, and this is my code ...
1
vote
1answer
21 views

LibGDX HexagonalTiledMapRenderer wrong stagger index?

Im using Tiled map editor, Hexagonal(staggered) map, libgdx version 1.9.9 If I set staggeredIndex = even in tiled map editor, ...
0
votes
2answers
80 views

Calculate size of hexagonal map libgdx

I have a staggered hexagonal map created with "tiled" map editor and I want to calculate the height of this map in pixels, the example map below should be ...
0
votes
1answer
47 views

How to render 3d object as 2d with different angles

I wanted to make a ship as a 3d object and import it with an atlas file to my 2d libgdx project with different angles like I saw it by another game. And I was wondering if there is a specific ...

1
2 3 4 5
45