#1 LibGDX Jam


Due to a lack of time, I wasn't able to work as much as I wanted. But at least I was able to implement some of the basic stuff.


The game consists of a stack of different ScreenStates. When starting the game, the MainMenu screen shows up and when you select a new game, the GameState is pushed onto the stack. If you pause the game, a PauseState is pushed, etc.
The top of the stack is the only state that will be updated and rendered. So if you push the pause state, the game will obviously be paused and to continue you just have to pop the pause state. Easy go.
public interface ScreenState {
  void update(float delta);
  void render(SpriteBatch batch);
  void dispose();
  void resize(int width, int height);
  InputProcessor inputProcessor();
The first four methods are straight forward, only the last is maybe a bit different. Of course, ScreenState could extend InputProcessor, but then, every state has to implement those eight methods. Instead I let the inputProcessor method return a processor. So in an actual ScreenState class, I could use an inner class extending InputAdapter or the class itself could extend InputAdapter and implement only the important methods.

Tilebased or "Room"-based ?

Which is the better solution? Answer: They are more or less equal.
+Simple collision detection: Just check if the tiles are free!
+Super simple pathfinding
-if based on an array: limited size
-Complete rooms will be placed, but each room would consist of several tiles...meh
Room based
+Unlimited in size
+One room is one unit
-pathfinding is a bit more complex

At the moment I prefer the later one and I hopefully stay with it! Would be a shame to change it later on...

Bad, bad design...

For an easy access, I added static access to the textures. Really ugly and bad coding style, but for a "simple" game like this one, it will work. (Don't do this at home!)

Room placement

Up to now, I only implemented the mechanics to place new rooms, without any fancy stuff. If a room can be placed at the cursor position, it is rendered in green and otherwise in red. No black magic here.

The room itself is nothing more than a placeholder. Later on there will be plenty of different rooms with different features, like a water recovery system, carbon dioxide reduction assembly and so on.

Next step

The next important step will be the implementation of simple people and the pathfinding for them.