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
Understand how to add collisions to our game objects as well how to add a background image that spans the length of our level.
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
and we also updated the game
camera to follow the player.
0:00
In this video, we're going to add some
collision detection to our level and
0:01
also add a background.
0:05
Let's get started.
0:07
The way to add collision detection to our
level is to tell Phaser which tiles we
0:08
want the player to collide with.
0:13
Although Phaser provides many ways and
methods to do this,
0:15
we're going to use a simple
method called setCollision.
0:19
The setCollision method is provided
by a tilemap layer object.
0:22
So in our case, we can use the tilemap
layer object from our ground level.
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