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 text to display messages such as 'You Win!' or 'Game Over' based on specific conditions or events, enhancing the player experience and providing clear feedback on game outcomes.
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
that the brick disappears and
the ball bounces at an angle.
0:00
In this video, we're going to add some
text to the screen when the player wins or
0:00
loses the game.
0:04
Let's start by creating the game
over text since this event will be
0:05
easier to trigger.
0:10
The game over text should only show
when the ball goes below the paddle.
0:11
We can detect this by checking if
the Y position of the ball is greater
0:16
than the Y position of the paddle.
0:21
Let's do that now.
0:23
In our update function below
the last if statement on line 76.
0:25
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