Java libgdx get clicked square without iter
I would like to detect which square is clicked without iterating over all elements! i don’t want to do this anymore for all elements. if( x >= this.getAnchorX()-HalfWidth && x <=...
View ArticleMaximum 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 96×96 to 300×300. Most layers are still displayed correctly but the tiles of a single...
View ArticleHow 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 use...
View ArticleImplementing 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;...
View ArticleWhy value 1 in OrthographicCamera viewPort width?
So, I read that camera = new OrthographicCamera(1, h/w); creates a camera with an appropriate width and height for the field view.. However, I can’t understand that value 1 for the viewport width, does...
View ArticleClearing a libGDX pixmap
Is there a way to clear a libGDX Pixmap? Or is the only way to dispose it and create a brand new Pixmap?
View ArticleBullet Collision Shape doesn't wrap Model correctly
i got an object called human and an object called platform. I simply let the human fall down on the platform with a constant speed. No acceleration! The problem is that my collision shapes for both (i...
View ArticleHow to resize animation in libgdx?
I want to draw an animation, the size of each frame is 500x500px but when I try to resize, the animation seems to rotate… Here the code to load frames and create animation: Texture fireSheet = new...
View ArticleSprites 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...
View ArticleLibgdx: different speed on different devices
I am running a simple Libgdx app that I have wrote, on my Android phone and Android tablet and I am getting the unexpected result of having different velocities when a body is moved. To move the body I...
View ArticleLibGDX Android Unclickable buttons on Dialog
I’m using the libgdx for a simple pong game only for Android and I’m trying to show up a dialog when the back button is pressed. My activity implements Screen, InputProcessor and in the keyDown method...
View ArticleHow would I create classes for each map tile instead of using a tmx? LibGdx
I am making a top down style game using LibGdx that I want to be randomly generated each new game load. I already have the algorithm to generate the array for what tile should be what. But i’m stuck on...
View ArticleHow to implement something as shown in the picture [on hold]
I am trying to make a game using libgdx framework problem: Initially screen is blank,then blue ball enters the screen from top, when blue ball reaches middle red ball enters,when blue ball reaches the...
View ArticleLibgdx Drawing a triangle cannot resolve method “render ”
I am looking to draw a triangle. I found a lot of code such as : https://github.com/libgdx/libgdx/wiki/My-First-Triangle-%28Example%29 The code I found are old I think; if I use...
View ArticleHow to get this type of movement in LibGDX?
I want objects in my game to move randomly but always from right side of the screen to the left side. The movement must be as smooth and natural as possible, like they are following a path. Can i...
View ArticleLibGDX particle emitter rotation
I have a libGDX game, in which I’d like to make some ice breath like effect using particles. So far we made a cone like effect. I can obtain and render it on the screen with this....
View ArticleBasic 2d platform collision detection algorithm has a slight bug (Java)
I’m trying to implement collision detection between Player (the main character) and a Platform. They are both modelled as rectangles; when player hits the side of a platform he should bounce off it and...
View ArticleSprites not being rendered on screen change – Android Libgdx
In my game over screen for my Libgdx Android game I’ve the following code which starts a new game upon a screen touch. if(Gdx.input.isTouched()) { ScreenManager.setScreen(new GameScreen()); } A new...
View ArticlePan camera within bounds of large image
I have a camera that I pan around a large image which works fine, however when I reach the end of the image I can keep panning on and on, forver. I have looked everywhere for an answer on how to...
View Articleerror in post a screen shot of game scores with Android Intent in LIbgdx game
I want to post a screen shot of my game on social apps. I have developed this game using Libgdx framework. I have created an interface in Core class. Here is its Intent share specific code. public...
View Article