Class Index | File Index

Classes


Class Player


Defined in: Player.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Player()
A class to represent the player on the screen
Field Summary
Field Attributes Field Name and Description
 
True if the player is moving down, false otherwise
 
True if the player is moving left, false otherwise
 
True if the player is moving right, false otherwise
 
The speed that the player moves at
 
up
True if the player is moving up, false otherwise
Method Summary
Method Attributes Method Name and Description
 
keyDown(event)
Called when a key is pressed
 
keyUp(event)
Called when a key is pressed
 
Initialises this object
 
update(dt, context, xScroll, yScroll)
Updates the object
Class Detail
Player()
A class to represent the player on the screen
Author: Matthew Casperson.
Field Detail
{Boolean} down
True if the player is moving down, false otherwise

{Boolean} left
True if the player is moving left, false otherwise

{Boolean} right
True if the player is moving right, false otherwise

{Number} speed
The speed that the player moves at

{Boolean} up
True if the player is moving up, false otherwise
Method Detail
keyDown(event)
Called when a key is pressed
Parameters:
event
Event Object

keyUp(event)
Called when a key is pressed
Parameters:
event
Event Object

startupPlayer()
Initialises this object

update(dt, context, xScroll, yScroll)
Updates the object
Parameters:
{Number} dt
The time since the last frame in seconds
{CanvasRenderingContext2D} context
The drawing context
{Number} xScroll
The global scrolling value of the x axis
{Number} yScroll
The global scrolling value of the y axis

Documentation generated by JsDoc Toolkit 2.3.0 on Sat Jun 27 2009 16:26:03 GMT+1000 (EST)