Introduction: Hack Flappy Bird on the DIY Gamer Kit

This tutorial will show you how to play around with and change the settings of the Flappy Bird game that is included in the DIY Gamer library.

For this tutorial, you'll need a Gamer and a USB cable. Make sure you've installed the Gamer library and that you've set it up correctly with Arduino. You can find the instructions here.

Step 1: Open and Upload Flappy Bird

The first thing we need to do is open up the Flappy Bird sketch included within the library. Go to File > Examples > Gamer > FlappyBird. The sketch will open up, and you'll notice that it's got quite a few comments to help you figure out what's going on.

Go ahead and upload the sketch with the Upload button (the second button on the top left corner of the Arduino window).

It's a good idea for you to get familiar with it and play around. Get a feel for it. How do you find the difficulty of the game? Try and get a good high score!

Step 2: Change the Bird's Flying Speed

What to change how fast the bird flies? change the flyingSpeed variable located at the top.

This number in represents how long the the delay is between each step in milliseconds, meaning the larger you make the number, the slower the bird will be.

 int flyingSpeed = 150;	

Tip: flyingSpeed = random(1000); will generate a random speed every game, who know how fast it will be!

Step 3: Change the Gap in the Wall

To change the gap, change the number initialised to int gapSize . The bigger the number, the wider the gap

 int gapSize = 3;

Step 4: Change the Thickness of the Wall

To change the thickness of the wall, change the number initialised to int wallThickness . The bigger the number, the thicker the Wall.

int wallThickness = 2;

Step 5: Play With Gravity

Increase the gravity affecting your Flappy Bird's flight by increasing int gravity. Be warned, it becomes hard very quickly!

int gravity = 1;

Step 6: Look Through the Functions in the Main Loop

The main loop is where everything happens in your game. This is surrounded by the boolean isPlaying. Making sure only certain things happen when in game play and others when not.

    gamer.clear();
    moveWall();
    drawWall();
    updateBird();
    detectCollision();
    recordScore();
    drawBird();
    gamer.updateDisplay();
    delay(flyingSpeed);

gamer.clear() : Clears previous screen, ready for new frame

moveWall() : moves wall one step from right to left

drawWall() : creates new wall

detectCollision() : checks if bird has hit the wall

recordScore() : updates score if bird has passed the wall

drawBird() : moves bird one step from left to right

gamer.updateDisplay() : prints newly determined frame based on all above functions

delay(flyingSpeed) : refresh rate of screen

Comments

About This Instructable

461views

6favorites

License:

Bio: Technology Will Save Us is a haberdashery for making technology in everyday life. We design, manufacture and sell DIY technology Kits and run workshops to ... More »
More by techwillsaveus:DIY Speaker Pieizo Plate ReverbDIY Speaker Talk BoxDIY Speaker Kit Spring Reverb
Add instructable to: