I’m releasing the source code of Snappy Frog, a Libgdx game for Desktop, Android, iOS, OUYA and Amazon Fire

July 25th, 2014

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/snappyfrog



  1. can u tell me please, how to deal with all screen sizes in android devices using libgdx (without black bars & no stretching)?

    thanks & sorry for my bad english

    Comment by BJ — August 29, 2014 @ 6:52 pm
  2. Your English is fine 🙂

    Check out Snappy Frog’s source code and look at the ResHelper methods. It should be straightforward to understand.

    Comment by pierotofy — August 29, 2014 @ 6:57 pm
  3. thanks, i’ll try it in my next game 🙂

    Comment by BJ — August 29, 2014 @ 10:20 pm
  4. hi..can you please guide me on how o display admob ads on a libgdx appliaction?

    Comment by sahil sethi — March 12, 2015 @ 8:22 pm
  5. to*

    Comment by sahil sethi — March 12, 2015 @ 8:23 pm

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.