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


Follow me @pierotofy and don't forget to
  • BJ

    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

    • pierotofy

      Your English is fine 🙂

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

      • BJ

        thanks, i’ll try it in my next game 🙂

  • sahil sethi

    hi..can you please guide me on how o display admob ads on a libgdx appliaction?

  • sahil sethi

    to*