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 further break down our game into prefabs.
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
We also started refactoring our code
by breaking things up into prefabs.
0:00
In this video, we're going to
continue refactoring our code.
0:01
If we look at our LevelOne file,
0:06
the biggest chunk of code is
related to the gameOver screen.
0:08
You can see it starts at the bottom,
at line 132, and
0:12
it goes all the way up to line 80.
0:16
Let's break this up into a prefab.
0:19
Let's open up our file explorer,
right click on the prefabs folder to
0:22
create a new file, and
we'll call it GameOver.js.
0:27
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