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.
0
votes
0answers
10 views
Rotate a Crosshair around a sprite - 2d worms style game?? (LibGDX)
I'm currently learning to code 2d games in Libgdx. Right now I'm making a kind of worms clone. I am using Box2d and have just my main sprite and a flat ground object so far.
What im stuck on is ...
0
votes
0answers
18 views
Libgdx font fails to scale well with viewport
I am trying to use libgdx Smartfontgenerator (link below) in my game that already has a FitViewport with my world co-ordinates but it scales out of proportion when I add in my fitviewport. Here's the ...
0
votes
1answer
22 views
Performance optimization when changing Textures LibGDX
In the main Screen class of my game there is a ListArray<Card> which makes up the deck of cards . The Card's texture is set in the constructor like so :
cardTexture = new Texture(Gdx.files....
0
votes
1answer
32 views
libgdx - Trying to load ttf font using asset manager
I tried to load a ttf font using an AssetManager like this:
FreetypeFontLoader.FreeTypeFontLoaderParameter freeTypeFontLoaderParameter = new FreetypeFontLoader.FreeTypeFontLoaderParameter();
...
0
votes
0answers
16 views
How to animate a sprite in libgdx with Spriter
So, I have an animation that I've created in Spriter and a class in libGDX that extends Sprite and contains a box2D body. What I've done previously is have a texture atlas and loop through it to set ...
0
votes
1answer
23 views
how to correctly scale box2d in libgdx
I'm currently using 800x480 resolution and FitViewPort and I divided that by PixelPerMeter variable which is equal to 10 and that helped to move my box2d body faster. But when I tried to use fonts I ...
0
votes
0answers
21 views
libgdx BitmapFont setColor works only the first time
Here's my code:
game.assetManager.get("fonts/zrnic40.fnt", BitmapFont.class).setColor(.5f, .5f, .5f, 1);
game.assetManager.get("fonts/zrnic40.fnt", BitmapFont.class).draw(game.batch, text, x, y);
...
0
votes
1answer
29 views
Repeating a background texture forever in libgdx
My "game" works with a pretty large playing field, so I need a repeating background. I've implemented this the following way:
Loading:
assetManager.get("texture_bg.png", Texture.class).setWrap(...
0
votes
1answer
21 views
LIBGDX Image tearing
I'm making an game in libGDX and I have been noticing some image tearing when camera is moving. Note that it happens only when the game is maximized and the camera x position is less than screen width ...
0
votes
0answers
17 views
Android libgdx - Sound plays only on desktop
I made a simple game in Android Studio 2.2.2 using libgdx. Currently, I use one background loop music and two sounds. When I run the game on Desktop Application everything works just fine. But when I ...
0
votes
1answer
54 views
What is a good approach to dynamically change actor Position?
In my card game there are 2 players with each player having a hand(a ListArray of of Cards.In this case its handPlayer1).
The Card class extends Actor.This is the code I use to deal the cards to the ...
0
votes
0answers
14 views
Is reusing BitmapFonts possible in GDX?
I'm loading multiple labels (100+) with different font types (max 10), but they have different sizes.
As I read the code and did the research, it's not possible to 'reuse' the font.
For instance, I ...
0
votes
1answer
35 views
How to use touchDown?
How to use Screen and touchDown?
...
playButton.addListener(new ClickListener(){
@Override
public void clicked(InputEvent event, float x, float y) {
((Game)Gdx.app....
0
votes
2answers
27 views
How do I get the 3d coordinates of my model Instance? [LibGDX]
I want to get the 3d coordinates (as a Vector3) from my model Instances.
with the following code I can only get the original coordinates, but in the render method, my model is rotating around the Y-...
1
vote
1answer
30 views
Libgdx game crashes on some devices without any Errors / Logs
I'm making a similar game to the talking tom game where a character is animated on the screen and talks back.
I have about 100 transparent PNGs for each animation.
There are 10 Animations.
Each PNG ...
1
vote
1answer
23 views
Libgdx Animation class? not iterating through frames?
I am making a 'simple' top-down space shooter in 2d using Libgdx. I have loaded the texture regions into arrays and created Animations inside my sprite, but when I call the getKeyFrame it seems to ...
0
votes
1answer
38 views
How to handle Game Screens? (libGDX)
In my game the main screen is the playscreen. But because I want to draw the menu and the gameover screen on top of the playscreen, I don't create separate screens for them. But if I want to replay, I ...
0
votes
1answer
20 views
LibGDX Box2d - How to only setLinearVelocity on X axis - problem while jumping
public void update(float dt){
float currentYVelocity = body.getLinearVelocity().y;
switch(currentMoveState){
case moveLEFT: body.setLinearVelocity(-walkSpeed * ppm, currentYVelocity);
...
0
votes
0answers
35 views
How would you go about applying curvature to the rendering of a flat surface?
I want to draw a 2D planet surface. I have a set of tiles, which by themselves are flat if you draw them. Now I want to apply something to the drawing process, which makes it look curved the more you ...
1
vote
1answer
21 views
Cannot use my objects method when accessing from Stage LibGDX
I have a class Card with the method setOwner. I have set up my touch input to use a hitActor to identify touches by getting the Actor's name like so :
public boolean touchDown(int screenX, int ...
0
votes
0answers
28 views
Bounding box (rectangle/polygon) for custom shapes and collision detection
I am a beginner in game development. I am using the libGDX with Box2D and struggling to come up with a solution for the following problem.:
How can I have a bounding rectangle/polygon for custom ...
0
votes
1answer
38 views
Pathfinding: grid based map of irregular numbered tiles to mark connections
Given this map:
The floor tiles are separated from the rest (its a map made in Tiled in separate layers) and as you can see, the id numbers are not in sequence.
¿How I would go about making ...
0
votes
1answer
91 views
Verify if a circle is completely inside a rectangle or not?
I am a beginner in game development. I am using the libGDX library. My question is two-fold.
1) First I'd like to know the best algorithm to verify if a circle is completely inside a rectangle. I ...
0
votes
0answers
14 views
Getting the default LibGDX prompt when running
I really couldn't find a way to word this better, and couldn't find anything on the internet either.
I've been reading Learning LibGDX Development as a new LibGDX user. I have successfully set up my ...
0
votes
0answers
8 views
libGDX' parallel of Android's Region
I'm an Android programmer trying to migrate to libGDX.
In Android I'm used to the Region class, which allows the creation of arbitrary shapes, including union, intersection and difference operations ...
0
votes
1answer
38 views
How can I rotate objects around a given point, and then move them to their correct world location?
I'm building a 2D game using LibGDX. I have a collection of Entities each with their own X and Y positions within the 'world'. The player moves around the world and also has its own X and Y world ...
0
votes
1answer
52 views
How do I load 100+, 480*800, 30KB PNGs into a frame by frame animation on Android without OOMs?
I'm an Android dev who's trying to get into game dev.
As the title says, I'm trying to load a hundred PNGs as an animation, fullscreen on Android, but no matter what I try, I always getting out of ...
1
vote
1answer
38 views
LIBGDX Perspective Camera in an Isometric view?
how can I set a PerspectiveCamera to view the game in an isometric view? What kind of angle would I use, and how would I actually translate this into the code? Math isn't my forte, so I can't really ...
0
votes
0answers
21 views
LibGDX log: MuxOMX ctor
I'm developing a game in Java for Android using LibGDX with Android Studio. I'm using the AssetsManager class and I've noticed weird log when finishLoading() is finished:
10-17 22:15:17.108 31943-...
-1
votes
0answers
28 views
Complex shapes for bodies with libgdx
I want to use add a body for a complex image with Libgdx and followed this tutorial: https://www.codeandweb.com/texturepacker/tutorials/libgdx-physics
but that doesn't work because of this error:
...
0
votes
1answer
34 views
Fine tuning light shader mechanics
I'm currently trying to implement the lighting technique described in this article.
I've done pretty much exactly what is done in the article. My technique is the same, and my shader is the same. ...
0
votes
1answer
37 views
Creating a 2D sidescroller with different behavior in each level
I'm creating a game with levels built from tilemaps in LibGDX. I've created the logic for the game that adds entities based on object layers, however, many levels have different behaviors. Do I need ...
0
votes
1answer
23 views
libgdx calculate vector to find new points
I am working with vector2 in libgdx.
I have (x1,y1) and magnitude 'M' with an angle 'D'.
How could I calculate (x2,y2) using vector2.
Thank You
1
vote
1answer
45 views
Java/Libgdx Pixel game with individual pixel changing
I am currently trying to make a game with pixelated graphics. The game is supposed to run with as few textures as possible. Instead of this it is supposed to generate the levels randomly, and fill in ...
0
votes
1answer
28 views
How to use Actors/Groups with ShapeRenderer instead of Batch?
I am intersted in using Actors and Groups on a Stage so that I can make components and subcomponents which draw relative to their parents, but I intend to do my drawing with a ShapeRenderer instead of ...
0
votes
1answer
31 views
LibGDX - why are the shapes from my ShapeRenderer resizing with my viewport?
I have created a class called Node which I would like to (currently) contain a single Actor (later I will be adding additional actors, but for now I'm sticking with just one). The actor is called "...
0
votes
0answers
25 views
Libgdx Actor doesn't perform action when called from Array
The Card actor does the action when it is done like this:
MoveAction moveAction = new MoveToAction();
moveAction.setPosition(TABLE_WIDTH/2, TABLE_HEIGHT/2);
moveAction.setDuration(10f);
Card card = ...
0
votes
1answer
32 views
How to smooth scene2d ui default skin?
I am usng uiskin.png, default.fnt, uiskin.atlas to create my game UI, but the images is blurred, How do I make it smooth?
0
votes
2answers
56 views
Draw a sprite when a key is pressed in LibGDX
I'm working with LibGDX. How can I draw a sprite when a key is pressed? I have tried with the following, but it doesn't seem to work.
if (Gdx.input.isKeyPressed(Input.Keys.X)) {
batch.begin();
...
0
votes
0answers
13 views
Caching draw meshes with indices-alike?
I'm learning LibGDX, and I understand that we can make a kind of cache on vertexes by using indeces. So complex meshes could reduce the vertexes usage by reference it with indices.
For instance, a ...
2
votes
1answer
24 views
Box2D body rotation problem
When my player jumps, I start a rotation and I want to finish it when he gets back on the ground.
My Player is jumping off the ground and landing back on in 1 second.
My physics are updating at 10 ...
0
votes
1answer
58 views
Only 20fps framerate in libgdx Android with ~190 Actors being drawn
I'm getting bad frame rates while developing a game on Android. I have been developing on desktop too and only have the issues on Android. I am testing with a Nexus 6 (can't imagine how badly it ...
0
votes
2answers
25 views
LibGDX - problem with AssetLoader
can someone tell me where i make a mistake? i want to use AssetLoader to load textures but.... always have the same error. I thought that problem is with my game so I made new project but I still have ...
0
votes
1answer
23 views
How to convert applied torque or angular velocity angle to a positive 0 - 360 degree?
Objective
To convert body.getAngle() to 4 direction (NSEW), when torque or angularvelocity is used
Because box2d body default angle is zero, I used it as reference to create my character direction. ...
0
votes
0answers
21 views
Libgdx Getting a SIGSEGV error when I fire a ranged attack after an enemy has been killed
I am making a 2d platformer and after an enemy has been killed and I fire 2 or 3 ranged attacks, I get a SIGSEGV error. It doesn't always occur exactly the same, sometimes I fire 2 attacks, sometimes ...
0
votes
1answer
70 views
How to create a path-finder for a map like this?
I'm not sure if this is considered grid-based, because as you can see there is also a line. And that line is also a non-walkable point, I have no idea how do I create a path-finder with a non-grid-...
0
votes
2answers
51 views
libGDX - How to rotate with a specific duration
I want to rotate my player to 90° for a specific duration. I know scene2d provides this, but I don't want to use it for my players.
With how much to rotate every frame, so after x seconds the ...
3
votes
1answer
157 views
What physics and pathfinding is used for a 2D top-down rpg game?
Im planning to develop a top-down oblique mobile game. But there is a question to my mind I need to confirm before I start. In the list below is my predicted ideas and questions.
If I'm working on ...
2
votes
1answer
33 views
How to set rotation of a projectile in a parabolic arc in Box2D? [duplicate]
I have trouble making my projectile - in this case an arrow - rotate as it should when it's travelling in a parabolic arc. It doesn't rotate at all while travelling, only until it collides with ...
1
vote
2answers
68 views
LibGDX - question about game UI
I have question about game UI. Im using only one Screen class in my game and for different "screens" Im using gamestates. My question is how to set stage with buttons (play button, pause button, ...