Questions tagged [libgdx]

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.

Filter by
Sorted by
Tagged with
0 votes
1 answer
51 views

Refactor Main Class of LibGDX Breakout Game

I started learning basic game dev with Java's LibGDX. For my first project I decided to code a Breakout clone so I can learn the basics. Currently the game fully works - the player can destroy all ...
ViceroyFaust's user avatar
5 votes
1 answer
147 views

Drawing a grid-based particle system

For some time now, I've been working on a game which is superficially similar in appearance to this one. A world is filled with particles that move and change state frequently (per frame, often). ...
paleto-fuera-de-madrid's user avatar
1 vote
1 answer
58 views

Path Following Algorithm for Entity

Within my game there are many entities, where each entity has a path (Array<Vector2>) assigned to it. No path to follow (indicating that the entity should ...
Mario Ishac's user avatar
5 votes
1 answer
97 views

Draw the tiles of the islands that are within bounds, using LibGDX

I am new person regarding LibGDX. I have written the below render method. I have a randomly generations oceans (where there are islands at random positions). Within the below code, ...
Mario Ishac's user avatar
1 vote
0 answers
76 views

Queuing outgoing packets to fix server lag issues

I have been developing a game lately, my first multiplayer game. I am using Netty and LibGDX. So previously, before this update I added, I was only queuing incoming packets, I had to do this because ...
Ben Beri's user avatar
4 votes
2 answers
96 views

GameOfLife on GDX

I would like to know if I did everything right and if there a way to do it more simple and\or better? GameOfLife - main ...
Eugene Shymko's user avatar
2 votes
0 answers
79 views

Don't Update Every AI Every Tick

In my game there are AI characters that try to either steal your gold or destroy the walls of your castle. Previously I simply updated them all every second, but with a large number of characters on ...
bazola's user avatar
  • 8,569
3 votes
0 answers
271 views

Drawing in libgdx

I have made a Java clone of the popular 2048 game. It works, but I drew the UI in the correct way. Images so you know what we're discussing: I'm basically not sure how to do this, whether I should ...
The Coding Wombat's user avatar
4 votes
1 answer
625 views

2048 clone in libgdx, handling assets, and OOP overkill?

I have created a 2048 clone, I wanted to take on a simple project since I have never actually finished anything. Now I have, though I'm not a hundred percent happy with the result. Images so you know ...
The Coding Wombat's user avatar
3 votes
0 answers
108 views

Loading image/texture sprites on GameScreen in LibGDX

I'm new to this framework, LibGdx. I need advice/suggestion for my game. Is it okay if I load my images in a single class? I'm a beginner and started learning LibGdx. I already coded my game screen ...
zarawayun's user avatar
5 votes
1 answer
105 views

Teaching an Old AI New Magic Tricks

Recently I wanted to teach the AI of my castle game how to use the spells that I have added to the game. You can try out the game here: Castleparts Initially I thought that I would have to add ...
bazola's user avatar
  • 8,569
9 votes
1 answer
628 views

Creating and playing animations for a game using LibGDX

It feels like there's quite a lot of code involved in order to manually build up an animation using the libGDX framework. In my specific case, I am creating a number of animations for a portrait view ...
bazola's user avatar
  • 8,569
5 votes
3 answers
371 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 ...
Wyatt's user avatar
  • 61
1 vote
1 answer
125 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 ...
Wyatt's user avatar
  • 131
10 votes
1 answer
242 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 ...
bazola's user avatar
  • 8,569
2 votes
0 answers
66 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 ...
Josef Young's user avatar
6 votes
1 answer
112 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. ...
bazola's user avatar
  • 8,569
11 votes
1 answer
358 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 ...
bazola's user avatar
  • 8,569
2 votes
0 answers
315 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-...
ElSajko's user avatar
  • 133
7 votes
2 answers
182 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 ...
bazola's user avatar
  • 8,569
14 votes
3 answers
297 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 ...
bazola's user avatar
  • 8,569
10 votes
2 answers
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 ...
bazola's user avatar
  • 8,569
18 votes
5 answers
508 views

"Heat spot" image generation

I wrote a function that generates an image like: The function is as follows: ...
StrongJoshua's user avatar
13 votes
2 answers
411 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 ...
bazola's user avatar
  • 8,569
26 votes
4 answers
3k 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 ...
bazola's user avatar
  • 8,569
8 votes
2 answers
97 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, ...
bazola's user avatar
  • 8,569
26 votes
2 answers
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 ...
bazola's user avatar
  • 8,569
4 votes
2 answers
200 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 ...
salarc's user avatar
  • 51
6 votes
1 answer
188 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 ...
bazola's user avatar
  • 8,569
14 votes
1 answer
3k 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 ...
bazola's user avatar
  • 8,569
8 votes
2 answers
8k 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 ...
Nick Savage's user avatar
4 votes
2 answers
1k 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 ...
bazola's user avatar
  • 8,569
4 votes
2 answers
294 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 ...
bazola's user avatar
  • 8,569
7 votes
1 answer
448 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, ...
bazola's user avatar
  • 8,569
5 votes
2 answers
331 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 ...
bazola's user avatar
  • 8,569
10 votes
1 answer
493 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 ...
bazola's user avatar
  • 8,569
2 votes
2 answers
4k 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 ...
Stefan's user avatar
  • 243
12 votes
2 answers
2k 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 ...
Stefan's user avatar
  • 243
6 votes
1 answer
2k 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 ...
Markus's user avatar
  • 161
19 votes
3 answers
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 ...
Simon Forsberg's user avatar
3 votes
1 answer
260 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. <...
talloaktrees's user avatar