Flappy Beard [Day 4] – Final refactoring, adding music and main character collision

Today it was time to do some heavy refactoring mainly in the gameplay state. All drawing methods are moved to a new helper class, this gives me a better overview of the core features of the gameplay (tube generating, main character moving and collision detection) which I left in the gameplay state. All graphics are stored now in another new sprite class. This class can also handle alpha and translation animations of the objects on screen.

Finally, I’ve added collision detection between the bird and tubes. Also I animated the bird when flying up and down. This was the last piece of the puzzle to complete the gameplay.

I’ve thought about adding some sound effects, but decided maybe it’s better to play some old school funky chip tune. I’m using the libmod library for Android now for the first time for playing music. It’s very small, CPU efficient and resource friendly I must say. On the title screen the player can toggle the music if it’s too boring. The music is also stopped / resumed when the app is interupted by the system.

   

* * * * *