Skip to content

Part 5 - Implementing Variables

Now, it is your turn to explore the codebase and ensure it runs correctly. A number of key variables have been commented out in some of the game scripts or left blank. For each script listed below, either change the variable declaration (the line that it is created) or declare (i.e. create) the variable itself to ensure a working game.

🎮 1. Player Controller 🎮

Ensure the flapStrength variable has a value that works for the game. Hint: There are two ways you can change this variable.

💯 2. Point Scorer 💯

Follow the instructions in the comment lines within this script to implement the scoreToAdd variable.

🟩 3. Pipe Spawner 🟩

Follow the instructions in the comment lines within this script to implement the spawnRate variable.

🟩 4. Pipe Movement 🟩

Ensure the pipeMovement variable has a value that works for the game.

--> Hint: You will need to change this in the Pipe prefab GameObject. it should be visible in the inspector.

🐤 🐤 🐤

You should now have a functioning Flappy Bird clone. It is still missing a number of features, but it is at least playable.