Back at the beginning of May, while my wife and I were getting ready for our upcoming trip around the United States, I picked up the following challenge:
- Build a Flappy Bird like game.
- No commercial software allowed.
- Three weeks of time.
- Bring it to as many platforms as possible.
- Sound and textures had to be made from scratch.
After some research, I ended up choosing the following open source tools to achieve my goal:
- Libgdx: a great multiplatform game library
- GIMP: imaging editor, for the pixel art textures
- Famitracker: an application designed to create music for the NES/Famicom systems, for the sound effects
- Eclipse: the development environment
- RoboVM: a Java bytecode to ARM translator for the iOS port.
Since the physics effects were trivial, I opted not to use a physics engine and wrote my own simple kinematics equations to make the frog jump (link to equations).
The game is designed to work on any screen resolution, employing linear scaling using virtual screen reference units. This choice has been a huge time-saver when I brought the game to multiple platforms. Font maps are generated at run-time to scale with the current resolution.
I ended up porting the game to Web, Desktop, Android, iOS, OUYA and Amazon Fire. You can play it online here: https://playsnappyfrog.com/
Most of the logic of the game is written in this file: LevelScreen.java
The complete source code is available on Github: https://github.com/pierotofy/snappyfrog1