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
0answers
5 views

impulse not applying to body

I'm just getting started with box2d and I'm trying to appyly impulse to a circle but nothing really happens. First I define 'ball' BodyDef bodyDef = new BodyDef(); bodyDef.type = ...
0
votes
0answers
9 views

How to determine the pixel coordinate values of regions in an image? [on hold]

I am following a tutorial on how to make a flappy bird clone from http://www.kilobolt.com/day-6-adding-graphics---welcome-to-the-necropolis.html. I am on the part where the actual graphics of the ...
0
votes
0answers
7 views

How to experiment for the value of gravity in Libgdx? [duplicate]

I am following a guide on how to play a flappy bird clone in the LibGdx framework. -http://www.kilobolt.com/day-5-the-flight-of-the-dead---adding-the-bird.html I am currently on the part where the ...
0
votes
0answers
5 views

Scene2d Stage Actor setup issues

I am creating a game using libgdx. In the same each level has a class. I have stage as a member variable of the class. To this stage, I add actors. Inside the levels class, I have attaced the input ...
0
votes
0answers
25 views

Good practice/pattern to create and draw high resolution 2D fish [on hold]

i simply want to create/draw a 2D fish with animation and implement it in my android application. For drawing i use gimp and the gameengine is libgdx. Why gimp? Because it is free and mighty and ...
0
votes
1answer
36 views

How do I derive an appropriate acceleration value for my game?

I am creating a Flappy Bird clone from this tutorial. I have a question about acceleration in libgdx. The author assigned the bird a constant acceleration vector in the constructor of the bird ...
2
votes
0answers
17 views

How to save file in assets so it can be properly loaded in Android Studio?

I am following a guide on creating a replica of Flappy Bird. - http://www.kilobolt.com/day-6-adding-graphics---welcome-to-the-necropolis.html The step I am having trouble is loading the texture from ...
1
vote
2answers
76 views

How do I limit the rotation speed of a mouse-following object?

I am trying to make a 2D top-down game where player controls a spaceship. The spaceship (a rocket) is just a sprite following the mouse cursor with a fixed speed and is always pointing toward the ...
0
votes
0answers
23 views

Libgdx getting random position on screen is null?

So, I want to get the random position on my screen to spawn enemies on them. but here's problem. int randX = r.nextInt(screenWidth); int randY = r.nextInt(screenHeight); Apparently these are null, ...
0
votes
0answers
14 views

There is any nosql database for libgdx? [duplicate]

my question is simple. There is any nosql database compatible with libgdx? , I have googled it but I didnt find anything. I only found that libgdx iplements sqlite.
0
votes
0answers
43 views

Create a Minimap of a Tiled Map with LIBGDX

thanks for stopping by to help! Having a little trouble with OrthogonalTiledMapRenderer. I've got a Tiled map that is 250x250 tiles, each 16x16 pixels. Trying to use a separate camera to draw a ...
0
votes
1answer
47 views

Desktop and Android diference in rendering [on hold]

I have my game setup and working on Desktop and Android. Once I create my core screen class, it stops responding on Android. I tested it on my phone too. It runs Android 4.0.3. Is there a special ...
0
votes
1answer
63 views

Multiplying by delta not giving smooth movement

I started working on my first proper game but reached a problem straight away. In short I have a game that runs most of the time at 60 fps. ( I am using Libgdx a popular Java framework) but my game ...
0
votes
0answers
39 views

No sql database for libgdx [closed]

Hello I am trying to store some data in my libgdx game. I think in Couchbase but I dobnt know how to intagrate it because my game is developed for Android/iOS. ¿There is any database no sql that ...
0
votes
1answer
39 views

How can I test if the mouse draw on the active tiles?

I want to draw some sprites in a tiledmap where the tiles are active. I want to draw with the mouse, so how could I compare the position of the mouse, the sprite position and the position of active ...
0
votes
0answers
7 views

Cut parts off a nine patch LibGDX

As you can see in the image i would like to cut off a few of the boxes when rendering teh nine- patch: Bits to cut off: Are there any LibGDX methods to cut off those bits?
0
votes
2answers
32 views

Libgdx getting screen size

I'm working on libgdx project. I basically recreate my game which I coded in xna to make it available for android. Here's the problem android has many screen resolutions, and I want to know how to get ...
0
votes
0answers
23 views

How to properly import a .tmx file with the image used to create it?

I tried to create some maps with tield map, and the image I use to create this map(tielset texture) is stored in the desktop. But after the map generation, I copied the file (map.tmx) and ...
0
votes
0answers
55 views

Reading a file with unknown encoding [migrated]

I use libGDX for developing a game for Android platform. In my game, I'll have to parse some file that contain some settings (skin customisation, user map reader). My current code works for, at ...
0
votes
0answers
30 views

Maximum tile and texture size for tiled maps

I'm currently making a game using libGDX and Tiled. Everything was running fine until I changed the tile size from 96x96 to 300x300. Most layers are still displayed correctly but the tiles of a ...
0
votes
0answers
25 views

How to use offline gradle for libgdx projects?

I use Android studio 1.0 and this version has offline gradle 2.2.1 . When I create a libgdx project, it starts to download gradle 2.2 but I have slow download speed and can't download it. How can I ...
0
votes
0answers
81 views

Implementing a game loop with interpolation

I am trying to implement the Game Loop interpolated found in this website http://www.gameprogblog.com/generic-game-loop/. Here is my implementation: long frameRate = 50000000; int maxUpdates = 3; ...
0
votes
1answer
39 views

Sprites and Box2d

I'm starting to see how box2d works now, except I dont know how to scale the screen to diffrent screen sizes and how i can convert Sprite sizes to box2d units. I know box2d uses meters and such, but ...
1
vote
1answer
61 views

How can I make this shader background more efficient?

I want to use a shader as a background for a mobile game. I'm using libgdx for my project. I've never written glsl before, but here's my attempt so far: http://glslsandbox.com/e#22332.13 On desktop ...
1
vote
0answers
16 views

Play videos via 3rd party library or as animation in libGDX?

I want to add an animated splash screen to my desktop game, which I develop using libGDX. Now I see there is no native support for videos in libGDX, so I guess I have two options: Include a 3rd ...
0
votes
1answer
22 views

LibGDX multiple enemies animations

Hello everyone i have a question about animating multiple enemies on the screen at the same time. Basically, i figured out how to use the Pool for creating enemies and dispose them after use etc.. ...
0
votes
0answers
23 views

Can't work with universal tween engine while having added it to gradle

I'm actually developing a game with libgdx and I'd like to create a splash screen. To do this, I must use the Universal Tween Engine. To add the Universal Tween Engine, I followed the instructions of ...
2
votes
3answers
187 views

Generating 3D-like effect

I'm making a 2D sidescroller game and want to give the blocks a 3D like effect. This way it looks like the player is walking on 3D blocks while walking on a 2D plane (thus having only x,y ...
0
votes
1answer
42 views

How can I draw things just in an area that can have a shape such as the shape of the letter B and not draw outside this form?

I want to draw stuff on an image, for Example, if I have a letter, as an image and I want to draw on the letter it is necessary that this image is touchable. This is what I did: Image.addListener ...
0
votes
1answer
40 views

Why table in libgdx game give wrong position

Can anybody guide me, I am creating a table in libgdx game on menu screen to set different buttons on my screen. here is the code for table draw table.setBounds(0, 0, Gdx.graphics.getWidth(), ...
7
votes
5answers
2k views

How can I mark levels as “complete” in a way that prevents cheating?

My first thoughts about marking levels complete is to just write the information to a file upon level completion and load that in once the app is opened up again. But how could I keep this safe from ...
2
votes
1answer
45 views

Libgdx Actions interpolation Fadeout

In libGDX there is a simple fade Interpolation that speeds up towards the end of the action animation. But what I am looking for is the reversed of it, it needs to start fast and slow down near the ...
0
votes
1answer
52 views

Move Box2D body towards mouse click

In a top down game using Box2D, I would like the player's Box2D body to rotate towards the mouse click, and then move to a point on mouse click (move, not teleport). I have worked out the rotation ...
-1
votes
0answers
35 views

libGDX sprite disappears after 5seconds

I`m learning java for some time and decided that I want to make a game using libGDX. Everything goes well except gravity and jumping. Im not using Box2D so i found tutorial where jumping was solved ...
1
vote
1answer
44 views

Why is the Hiero font not coordinated to fit neatly in the display window?

I imported a font with Hiero and I draw the font like: font.draw(batch, "1", 0, 48); This is the resultant image: So the font it moved up to hit the bottom perfectly, but it doesn't touch the ...
0
votes
0answers
20 views

Rendering a trail after an object as it moves [duplicate]

I'm struggling with implementing a "trail" effect after a vehicle - a rocket for example. I would like to have some control over it (erase a part of the path or possibly detect it's collision with the ...
0
votes
1answer
36 views

how can I split the screen into two screens and make Gdx.input.setInputProcessor () accept two processors?

I want to draw in the first screen portion, and manipulate the buttons in the second part. This is what I tried: if (mouse.x <600) { Gdx.input.setInputProcessor (new InputProcessor () { ...
0
votes
1answer
42 views

Libgdx, how do i get the translation and rotation of a node from a model instance?

I have a model instance of a character, and a model instance of a sword weapon. THe character has a node on his right hand so he can "carry" the sword. Right now I use this code so the sword's ...
0
votes
1answer
35 views

Make continuos movements with controllers in LibGDX

I've been trying to make the OUYA controlers work with a LibGDX Framework Practice Game. Everything is working perfectly expected for one thing : The movements are not continuos. The problem is, ...
0
votes
0answers
33 views

Choosing assets for different screen densities and sizes? (libGDX)

I am making a 2D game. As I understand it we typically have maybe 4 sets of assets (xxhdpi, xhdpi, hdpi, and mdpi) so that our game runs well on all devices. These are just scaled versions of the same ...
0
votes
1answer
43 views

Artefacts when drawing textures

I am working on a level-based android game. The level is constructed of many blocks, all drawn with the same texture. Until now I didn't have any problems with drawing the different textures next to ...
1
vote
1answer
28 views

Rotating towards a point in Box2D

I'm using Box2d as my physics engine and I'm trying to solve what would normally be a simple problem but what has become a nightmare for me and preventing me from finishing my app. (6 months work) ...
0
votes
1answer
41 views

Libgdx drawing semi-transparent circle on pixmap

I am currently working on an android game using libgdx and would like to add a joystick to its interface. For this I use the built-in touchpad class. Untill now I have used external images for ...
0
votes
0answers
15 views

libgdx not rendering tmx

I am having trouble rendering my tmx files. I am using libgdx, I have tried removing all the box2d stuff but it still does not work. In tiled editor, when i save it as an img and render as a texture ...
4
votes
3answers
102 views

How can I check if a player-drawn line follows a path?

I want to draw an invisible path that the user must follow. I've stored that path as points. When a player draws a line, how can I test if it follows the path I've stored? Here's an example for ...
0
votes
2answers
56 views

Downscaling an asset, still pixellated?

I created a rounded rectangle in photoshop, and I rasterized the rectangle before I saved it. Yet, when I try to use the rectangle in libGDX, it looks pixelated. How can I make it so that it's smooth? ...
0
votes
2answers
97 views

Why not just create very high resolution graphics and use them on all screens?

I'm creating a game with pretty basic graphics (numbers, blocks, words, and a few nice design elements for the logo and such). My question is: can I create everything in a very high resolution- say ...
2
votes
1answer
51 views

LibGDX camera position shifted on movement

I'm programming a game with LibGDX and Box2D and I want my camera to follow my player. But as I zoom in (because Box2Ds metric system, using camera.zoom = x) the camera is shifted when the player ...
0
votes
1answer
52 views

Is using camera and viewport in Libgdx always necessary?

I understand that camera and viewport are important to keep virtual measurement units and handle different aspect ratios and resolutions when building games with worlds bigger than the screen (e.g. ...
0
votes
2answers
64 views

Mysql database reading and writing [closed]

In my Libgdx application I would like to be able to connect to a mysql server securely and read and write data from it without other users injecting, or changing information. I've found this: ...