Keeping Score and Obstacle State

Learn how to deal with scores and obstacle states and then run the complete program.

Flappy Dragon keeps a count of how many obstacles the player avoids and uses this number for the score. The State object needs to include the player’s current score and the current obstacle. We will extend the State struct and constructor to include these:

Get hands-on with 1200+ tech skills courses.