Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Unity Basics!
You have completed Unity Basics!
Preview
Implementing a simple score system is a great way to improve this game. In this video, we’ll see just how easily it can be accomplished.
Unity 6 Documentation
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
At this point,
we have a functioning and looping game.
0:00
This is fantastic.
0:00
But we need some kind of reward
for the player, or
0:02
this will not give any incentive
for them to play more than once.
0:04
What we need is a score system
to let them know
0:08
how far they've gotten in their run.
0:10
This will give them a goal
to try and beat the next time they play.
0:12
The idea
0:16
is that every time they make it through
a set of pipes we'll increment their score.
0:17
So as I mentioned before,
0:21
the GameManager script is a great place
to keep track of this.
0:22
Let's open it up.
0:25
This is going to be very simple.
0:27
We need a variable to keep track
of the current score, a method to increase
0:29
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up