Lesson 5: Animation

In this lesson, we’ll add a simple animation to our Flappy Bird game.

Piskelapp

saveThe web application, Piskelapp.com, is a great tool for designing pixel art. Visit the site, create a new “Sprite,” and reproduce the two images below in separate frames.

 

Once you finish reproducing the images above, increase the size 4 times (x4) as in the image, and save it as a PNG. We will import these sprites into our Sprite folder.flap and fly

Level_02

If you’ve already created a level that you’d like to preserve, simply duplicate the “Level_01” scene and call it “Level_02.” Duplicate the “Bird Prefab” as well and place the new prefab in the new level under the “MainScene” script.

Bird Script

To “wire up” the animation, you’ll have to modify your “BirdScript.” The complete script is available below. Make the requisite changes to yours based on what you see below.

Sprite Editor