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 Object-Oriented JavaScript: Challenge!
You have completed Object-Oriented JavaScript: Challenge!
Preview
See the solution for the handleKeydown() method.
This video doesn't have any notes.
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 review
the handle key down method you
0:00
added to the game class and the event
listener you added to the app.js file.
0:00
Head to your Game.js style.
0:05
The handleKeyDown method was
put inside the game class,
0:08
right below the start game method.
0:11
Note that the method receives
the event object as an argument.
0:12
I've shortened the argument name to e.
0:16
This is the actual event
object that is passed to
0:19
the event listener
callback method in app.js.
0:22
First, I included an if statement to
check whether or not the game was ready.
0:26
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