Return to Video

Event Listening - HTML5 Game Development

  • 0:00 - 0:04
    Now for this next task, what we'd like you to do is actually hook up mousemove
  • 0:04 - 0:08
    and keydown to proper listener events. So that we can receive and then respond
  • 0:08 - 0:13
    to those two actions appropriately. Now remember, the proper syntax to add an
  • 0:13 - 0:17
    event listener is as such. Make sure you utilize this while filling out your
  • 0:17 - 0:21
    code. Now for mousemove, the event object itself will contain two properties
  • 0:21 - 0:25
    that you'll need to use. The client x and client y values represent the
  • 0:25 - 0:29
    position of the mouse on the canvas itself not on the webpage. So make sure you
  • 0:29 - 0:33
    take that into account. The onKeyDown event, instead of containing a clientX
  • 0:33 - 0:36
    and clientY, contains a keyID property.
Title:
Event Listening - HTML5 Game Development
Description:

more » « less
Video Language:
English
Team:
Udacity
Project:
CS255 - HTML5 Game Development
Duration:
0:37

English subtitles

Revisions Compare revisions