Lesson 3: Add a Counter

In this lesson, we’ll extend our Flappy Bird Clone by adding a counter to the game.

GameObject

Click GameObject > UI > Text and name the object “Count.” You may change the text to display “Flaps: 0” – though this will be changed dynamically in the code.

Position this GameObject in the top left corner of your game.

MainScript.cs

Read the comments in the code below to see where to add each line of code.

Challenge

Try to display the score on the lose screen. You’ll need to add the code below to your LevelManager script.

LevelManager.cs