Dinoleon is an example game using Fleks entity component system in a LibGDX game.
It is a very small and simple game where the player controls a Dinosaur that can switch colors like a Chameleon. There are walls spawning periodically from the right edge of the screen and as a player you need to switch the color of your dino within time to not get hit by the wall. If you get hit five times, you lose. There are three different difficulties which increase the number of spawns, how fast they spawn and also how fast they move.
The controls are:
- Mouse for any UI menu related buttons
- QWER to change colors
- Q -> red
- W -> green
- E -> blue
- R -> orange
The main purpose of Dinoleon is to show how Fleks can be used. Do not use it as a best practice for game development!
Like e.g., It is total nonsense to use a physic engine like Box2D for a simple game like that but in order to challenge Fleks and to see its capabilities I used it in this game.
- RenderSystem as a sorted IteratingSystem
- PhysicSystem as a fixed interval IteratingSystem and ContactListener for Box2D
- ScenerySystem as an Intervalsystem
- PhysicComponent with a ComponentHook to properly cleanup physic related resources
You can find system code in the system
package and component code in the component
package.
-
Arks: Dino Sprites
-
Szadi art: Platformer Fantasy Free Package
-
craftpix.net: Jungle Cartoon GUI
-
cooltext.com for Logo Generator
-
Tim Beek: Music
-
FallenBlood: Sfx
-
Imagemagick to split images. Example:
magick convert dino_blue.png -crop 24x24 game/dino_blue/frame_%02d.png
-
GDX-Liftoff for basic project setup