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 Game Development with Phaser!
You have completed Game Development with Phaser!
Preview
Learn how to add a heads up display, how to keep score and how to load the enemies we added to or level in Tiled.
Resources
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
In this video, we're going to
add a score to the coins and
0:00
show the score on the screen.
0:02
Let's start by adding the score text.
0:03
Let's scroll down to the create function
and go below all the player-related code.
0:06
Then at the end of line 49, hit Enter and
write this.add.text, add parentheses.
0:11
And in the parentheses,
we want to give it a first argument of 30,
0:18
a second argument of 30.
0:22
And the third argument will
be a string of SCORE:0.
0:24
Make sure there are no spaces
between the colon and the 0.
0:28
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