The libgdx project is an open-source cross-platform game development library written in Java. It abstracts away the differences between writing OpenGL-based games on various platforms.

learn more… | top users | synonyms

6
votes
3answers
338 views

Finding and moving the next obstacle in a player's path

This code finds the next obstacle in the player's path, then moves it. I am trying to make it more efficient, because this code runs for each frame, and it lags a bit. It does work though. There are ...
0
votes
0answers
28 views

Libgdx play class becoming overwhelmingly complex/messy

I came here today to see if I could get some pointers to cleaning up some code for my game. I started developing this game, and now the class seems to have gotten way to big. It's the play screen ...
1
vote
1answer
83 views

Organizing Blockers and Ingots

What are the best practices to writing clean, expandable game code? I always end up getting overwhelmed with my games because the code gets very unorderly. I use OOP (java), but I still feel like my ...
10
votes
1answer
145 views

Game Tutorial in Java

I’ve been working on a Rampart inspired multiplayer game for a few weeks now, and it is finally in a playable state. The big thing left to do before going alpha was to add a tutorial to the game. I ...
2
votes
0answers
50 views

Alternative to clicklistener inside an anonymous class

For a trivial word game, I wrote the following code for the player to choose one of the two choices of words that in turn were read from a sentence. My question lies in first in the click-listener of ...
0
votes
0answers
33 views

Special-case sprite positioning

I have several objects which are assigned a certain size and position, works fine. The only problem is that in certain special cases the item has to be positioned a bit to the left and be a bit ...
6
votes
1answer
61 views

Normalizing forces for basketball game

Recently I found the need to implement a normalization formula in a couple of places in my basketball game, so I created some static methods inside of a class to do so. ...
11
votes
1answer
155 views

Basketball Collisions with Box2d

I'm working on a new prototype that is a simple drag and shoot arcade basketball game. For this project I am working with LibGDX and the Box2d physics library. You can play the game here: Play ...
2
votes
0answers
100 views

Multi class-type Object pool based on Libgdx Pool

I've done some code so you can obtain Object of any Class from Pool, take a look at it, is it safe? At least it works. MultiPool class has method obtain with Class param, so can know from which inner-...
7
votes
2answers
164 views

Pairing Labels with Images when building a UI

In a prototype 4X space game that I am working on recently, I have two different scroll panes to show the ships and the stars of the player. The ships are displayed in a vertical scroll pane on the ...
14
votes
3answers
238 views

What kind of Wall should it be? (for an RPG)

I'm creating an RPG type game, and now I am working on procedural town generation. The algorithm for that creates some roads going horizontally and vertically, and then attempts to place buildings in ...
10
votes
2answers
1k views

Game Terrain Generation based on Images

Lately I've been working on adding Scenarios to my city building game. I wanted to create custom terrains for some of the different scenarios (such as a chain of islands, or a volcano). I decided ...
14
votes
5answers
425 views

“Heat spot” image generation

I wrote a function that generates an image like: The function is as follows: ...
12
votes
2answers
190 views

World Generation for City Builder

I decided that I wanted to add some spice to my bland looking city maps, so I created a couple of algorithms to add water to the map. I also added a "marshlands" setting that would just randomly ...
22
votes
4answers
631 views

Convert Bitmap Font to Texture Atlas

I wanted to render the textures that comprise a bitmap font glyph onto the screen directly as an Image in libGDX. When you make a bitmap font using a program (such ...
8
votes
2answers
80 views

Take These Buttons Back

I created a side bar of buttons for my game, the idea being that if you click on the "main" button of the group, the rest of the buttons in the group would pop out from the side of the screen. Later, ...
21
votes
2answers
1k views

Please Save My Name

I wanted to create a save game system for my city building game that did not require the player to input a name for the city. It was also important to allow infinite save games, so I could not just ...
4
votes
2answers
112 views

Skill system optimization

This code feels long and clunky to me. How can I make it shorter, if possible? I am writing for a libGDX game, and I need a skill algorithm. I want it so once the player picks up something (which I ...
6
votes
1answer
165 views

A Mess of Missions

I've mostly completed the prototype for my city building simulation, and now I have added the meta-game mission system to the game. You see these mission systems in a great many games these days. The ...
12
votes
1answer
888 views

Isometric City Building Game

I have recently been working on my first game with an isometric perspective. For those who don't know, an isometric perspective is a pseudo 3D view created from 2D tiles. I am working off of this ...
1
vote
0answers
111 views

Recreating pong

Github is a link to all my code and the working JAR file. I have been learning LibGDX and attempted to make a working Pong game, I am new to this and would like some pointers on where I could improve ...
8
votes
2answers
492 views

Recursively evaluate neighbors in a two dimensional grid

I'm creating a puzzle mini game where there is a board of gems, varying in color, and chosen at random. This is what my code generates: When you click on a gem the game should traverse the board and ...
4
votes
2answers
349 views

Simple High Score Server for HTML Game

I have implemented a basic high score server for my strategy game. The goal here was to get the high scores working for the browser based version of the game (I am using the libGDX library with GWT ...
4
votes
2answers
224 views

TextField Validation for Teleport Feature in Game

I've implemented a teleport feature for my game and I would like some feedback on the way that I validate the user input. I am using the libGDX library. When the player clicks the Teleport Menu ...
7
votes
1answer
246 views

Custom Serialization of Game World

I'm working with libGDX for a game, and over the last few days I have tried a few different types of serialization before settling on a custom serialization implementation. XML had huge file sizes, ...
5
votes
2answers
195 views

Strategy Game Menus and OOP

Most of my experience is with Objective-C, so I am relatively new to Java inheritance. I understand that there are concepts such as abstract classes and interfaces, but I am still not totally sure ...
10
votes
1answer
280 views

World Map Viewer with LibGDX

I am working on a game where the player can walk around a world comprised out of a grid of tiles. The World object contains a ...
2
votes
2answers
2k views

Simple LibGDX Pong game 2.0

I have been working on my Pong game and I added some nice new things to it. You can now select the difficulty on the start screen and I also added a pause screen. Also I gave the Pong ball a tail just ...
12
votes
2answers
1k views

Simple LibGDX Pong game

I created my first java game in LibGDX and it's working fine but I'm 100% sure a lot of my code can be written shorter than now. Does anyone have tips how I can make this code better? Like the ...
6
votes
1answer
1k views

Performance optimization on Box2D with libgdx

A few days ago I decided that I wanted to get involved with libgdx. So far I'm blown away by how simple it is to get something on the screen to work with. I'm trying to make a very simple tech demo ...
19
votes
3answers
2k views

I'm Simon, and this is what I say

Play my game! Having the name that I do (Simon), of course I have to participate in this challenge! (Even though I am a bit "late", but Simon says "have forgiveness!") This is an implementation of ...
3
votes
1answer
211 views

Updating libgdx game framework library files

I wrote a script that updates some library files for the game framework libgdx by grabbing the latest nightly build .zip file from a server and extracting the contents to the appropriate locations. <...