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
20 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
35 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
26 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
9 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
8 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
30 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
10 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
15 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
13 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
11 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
13 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
11 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
55 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
8 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
16 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
117 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
40 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
43 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
48 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
31 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
138 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
29 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
20 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
89 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
39 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
91 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
50 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
15 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
29 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
34 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
120 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
21 views

Get json response in libgdx

I am trying to get json response in libgdx. Here is my libgdx code. ...
0
votes
0answers
16 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
18 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
66 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
46 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 ...
0
votes
1answer
33 views

how to use preferences in libgdx

I am trying to save a username for game in preferences (first time user enters the game, registration screen shows up, and after that whenever user enters the game, username is automatically ...
0
votes
2answers
79 views

Moving cars on a tiled map

I'm writing a game which is situated on a tiled map. I have a PlayState on which there's a Board which cosists of Fields. My Board is an isometric map of a city, where each tile is a kind of road. ...
0
votes
1answer
24 views

Libgdx: converting between two camera coordinates

I had a similar issue to the question here: Why is my text is too large even when scaled to .05f in libGDX? So I created a second camera for my text elements. I'm rendering the text above some other ...
2
votes
1answer
71 views

How to draw a string into a polygon? (Libgdx, Java)

I am working on a 2D grand strategy game (like Hearts of Iron from Paradox but as I said only 2D game) and I would like to render the area names on the map. I made the Polygons for each area. How can ...
0
votes
0answers
29 views

How can I archive a Big TiledMap with LibGDX?

I'm trying to archive a big map on my game, 2400x900 of 64x64 tiles using TiledMap and LibGDX. What is the difference in performance of using a 100x50 tiledmap vs a 2400x900 map? Say they both have ...
1
vote
0answers
44 views

Moving with rotating in 3D world in Libgdx

I'm trying to create a first person system in my game which consist of a big cube with grass texture , so the problem happens when I move and try to rotate the camera the world rotate and I'm not on ...
0
votes
1answer
112 views

How to make a world map from image like in paradox games? (Java, LibGDX)

I'm working on a grand strategy game similar to those made by Paradox Game Studios with their Clausewitz engine. I'm trying to create the world map from an image. On that you can see the areas, and ...
0
votes
1answer
39 views

Graphic render speed in libgdx using many sprite sheets

I am currently working on a customizable Player-character for my top down view 2D pixel game. I am using libgdx and aiming for android devices as well as desktop applications. I am wondering about an ...
0
votes
2answers
58 views

Disposing objects when changing screens

I'm making my first game with LibGDX and Box2D, and I've realized that the memory used increases when I change screens. It starts from 150MB and progressively reaches 850. How should I deal with this? ...
0
votes
1answer
90 views

How does the stateTimer parameter is initialized in this method getKeyFrame(stateTimer)?

I have been following the tutorial https://www.youtube.com/watch?v=1fJrhgc0RRw&list=PLZm85UZQLd2SXQzsF-a0-pPF6IWDDdrXt&index=11 I an not able to understand what is stateTimer in getframe ...
0
votes
1answer
49 views

LibGDX FileHandle does not delete file

I'm using this line of code to delete a file: if(Gdx.files.local("/files/ids.json").exists()) { Gdx.files.local("/files/ids.json").delete(); } The same code ...
0
votes
1answer
47 views

Pause Tiled animation during game in LibGDX

I’m using Tiled with LibGDX and I have some animated tiles. When the game is paused I would like their animation to be paused as well. Is this possible? The map is drawn with ...