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 load images into your game using the Phaser framework using both the preload and create methods from a game scene.
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 learn
how to load some assets into our game.
0:00
Let's start by opening the preload
function on line 19, then let's write
0:01
the following code, this.load.image
with parenthesis and a semicolon.
0:06
Let's go through what we've just written.
0:12
Whenever the this keyword is used
inside a scene function like preload,
0:15
it references the scene itself.
0:19
In other words,
it gives us access to all the methods and
0:22
properties that can be used
to modify a specific scene.
0:25
One of these properties is called load.
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