A very simple desktop and OUYA 2D platform game built in JAVA with libGDX simply to demonstrate the use of various technologies and design patterns as I was learning them. This is, by no means, a complete video game and it puts no effort into being one.
The following commands should be enough to run the game in any desktop platform with JAVA 1.6+ installed.
git clone https://github.com/nfantone/ninja-rabbit.git
cd ninja-rabbit
gradlew desktop:run
This project was developed using the following frameworks and tools:
- libGDX - A great JAVA game development framework.
- gdx-ai - Artificial Intelligence framework for libGDX games.
- Box2D - Physics engine. libGDX has a built-in JAVA implementation of it.
- libgdx-utils - A set of utility classes and methods that alleviates common work while using libGDX. Written by the renowned @dermetfan.
- Physics Body Editor - Developed by Aurelien Ribon, this tool allows you draw Box2D bodies for your sprites, export the data as
json
and load them in your libGDX game. - Tiled - Free tile map editor. Used as a level editor, as well as laying out physics related objects.
- TexturePacker - Creation of sprite sheets. Allows exporting to libGDX atlas format.
An artemis-odb implementation is in the making.
With the exception of TexturePacker, all of the above are free and open source projects. You might as well considered donating or contributing something back if they have managed to help you in some way or if you enjoy using them.
libGDX has its own open source texture packer, as an alternative to the CodeAndWeb application.
Ideas for the architecture and design were shamelessly taken from the phenomenal Game Programming Patterns online book, by EA developer @munificentbob, following the path of Erich Gamma and cia. Honorable mentions go to the Component, State and Observer design patterns. All of them were implemented in ninja-rabbit.
Game Programming Patterns is a must read. If you think of yourself a game developer or enthusiast, you owe to yourself reading it.
Also worth mentioning, is the handy work of ForeignGuyMike who created the LibGDX Box2D Tiled video tutorial series. Great for starting out with Box2D and drawing sprites.
Let's not forget the invaluable help of the Libgdx Cross-platform Game Development Cookbook. You should give a it try.
- You move the rabbit character around by using the
W
,A
,S
,D
keys. Self explanatory. - Collect carrots for points and trivial fun.
- If you fall down a pit, you'll lose a life and respawn at the beginning of the level.
- There is an arbitrary ticking clock. Provides a sense of imminent doom.
- You have three lives. Losing them all means game over. No continues. Use them wisely.
The rabbit character in the game is the work of graphic designer Julieta María Ojea (@JulietteChuu). Tiles and other assets were gracefully borrowed from the Platformer Art Complete Pack published under Creative Commons license by Kenney Vleugels