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
0answers
20 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
0answers
14 views

Android LIbgdx game two objects collide then object2 reposition isn ot working properly [on hold]

if(object-A.collides(object-B.getBounds())){ coins.get(i).reposition(500); } Android Libgdx java
0
votes
0answers
21 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
41 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
14 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
103 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
12 views

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

The Preference and AssetManager documentations don't mention this.
0
votes
0answers
27 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
17 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
79 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
25 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
85 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
32 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
14 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
28 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
30 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
19 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
78 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
19 views

Get json response in libgdx

I am trying to get json response in libgdx. Here is my libgdx code. ...
0
votes
0answers
15 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
15 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
47 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
23 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
76 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
21 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
59 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
24 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
29 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
95 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
35 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
47 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
88 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
37 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
36 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 ...
1
vote
0answers
65 views

How would I go about serializing my LibGDX game?

I am currently using Kryo for serialization. I have a Player class, but it extends Sprite. Sprite isn't serializable. This means I can't serialize Player as a whole. Is there another way to do this? ...
0
votes
0answers
22 views

Dealing with ghost vertices of Kinematic bodies in Box2D

I'm using LibGDX and Box2D and I want to have multiple falling platforms in a row which will fall sequentially as the player runs on them, like in the picture below. (the shapes are parsed from Tiled) ...
0
votes
1answer
34 views

How to launch Libgdx cross-platform (Android, HTML, Desktop) multiplayer client with socket?

So i'm struggling with making my cross-platform client side to work, specifically on HTML part. I have java server that is responsible for all the controls and events, and I control it via netty-...
1
vote
1answer
24 views

Extending the camera vs CameraHelper class vs camera field

I am following an eBook called "Learning Libgdx Game Development" In it, the author implements a CameraHelper class that implements ...
0
votes
0answers
24 views

Optimal way for adding text inside a LibGDX ProgressBar?

I have a working healthbar set up for my game. But I also want the health to be displayed inside the healthbar as text. So for example something like "365 / 900", meaning the player has 365 hp out of ...
0
votes
1answer
26 views

Aligning animation frame assets with different sizes

I have code that changes texture in each frame depending on the player's state - walking, idle. My problem is that the idle texture (from separate png) has a slightly different size, and due to that ...
0
votes
0answers
14 views

Libgdx Touchpad Edge Detection

I have implemented an on-screen touchpad that controls my player shape. I can move the player based on the changes on the touchpad knob using the ChangeListener ...
0
votes
2answers
57 views

Box2d: Destroy body or setActive to false?

What is better practice when a body goes out of screen, to destroy the body or just setActive(false)? I guess in terms of memory it is better to destroy it and free the memory, but is destroying ...
0
votes
0answers
28 views

How can I add background color to a libGDX TextButton?

I have a TextButton in my libGDX project and I want to add a color background to it. I tried the setColor() method but that didn'...
-5
votes
1answer
55 views

When making a game using libgdx the program immediately closes when being run

The problem is similar to my last question, but some of the errors are fixed. The file: ...
-3
votes
1answer
34 views

Making a game using libgdx and when running the program immediately closes [closed]

When I run the program the window immediately closes and gives some errors. GameMapImpl.java : ...
0
votes
1answer
91 views

Multiple Bitmaps in Rectangle area

I am trying to build a card based game in which a card is added to player after every round. To win the match player has to remove all cards from his deck. However I have also drawn some additional ...
0
votes
1answer
41 views

LibGDX/Tiled rendering order

I'm using LibGDX and Tiled. I need to render a Texture for my repeated background, then myTiled map and finally the sprites. My problem is that if I put ...
0
votes
1answer
46 views

Libgdx - Screen tearing (or artifacts) while in fullscreen

I have a problem with libgdx, fullscreen and what I believe is screen tearing or any other sort of artifact. In windowed mode, everything works fine, but when i switch to fullscreen, moving sprites ...
0
votes
0answers
38 views

Box2D - Proper way to simulate player's body and feet

I'm new to LibGDX and Box2D, and I'm trying to create my player's body but got some issues. I've created the ground as a ChainShape, and my player as a Rectangle. I want to attach a fixture for its ...