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 use Phaser's Arcade physics to add collisions to physics bodies in our game, particularly between the paddle and the ball.
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 gave the ball some movement.
0:00
In this video, we're going to add
some collisions between the ball and
0:00
the paddle.
0:03
This is actually really easy to do
with Phaser In our creates function
0:04
below line 46 where we
set the ball bounce.
0:09
Let's add the following code or
press ENTER then
0:13
type this .physics.add.collider();.
0:18
The collider method in phaser allows us
to add collisions between two objects.
0:24
Now, we can pass the two objects we want
to collide as arguments in the collider
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