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 physics properties to the ball in our breakout game so that it is affected by gravity.
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're going to add some physics to our
game to prevent that from happening.
0:00
Let's make sure we're at
the top of our file, and
0:03
we can enable our page
physics in our config object.
0:06
We can do that by adding the following
code below the scene property.
0:10
Let's add a new property called physics,
and this is an object.
0:15
This is used to set the physics engine for
our game.
0:20
Let's open this object and
give it some properties.
0:25
We'll first give it
a property called default.
0:28
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