main.js
//Function called when key is pressed down
Function called when key is pressed down
Function called when key is pressed down
function onKeyDown(event)
{
	if (event.keyCode == KEY_UP)
	{
		Player.directionY = 1;
	}
	if (event.keyCode == KEY_DOWN)
	{
		Player.directionY = -1;
	}
	if (event.keyCode == KEY_LEFT)
	{
		Player.angularDirection = -1;
	}
	if (event.keyCode == KEY_RIGHT)
	{
		Player.angularDirection = 1;
	}
	if (event.keyCode == KEY_SPACE && ShootTimer <= 0)
	{
		ShootTimer += .5;
		playerShoot();
	}
}
function onKeyDown ( event ) { if ( event . keyCode == KEY_UP ) { Player . directionY = 1 ; } if ( event . keyCode == KEY_DOWN ) { Player . directionY = - 1 ; } if ( event . keyCode == KEY_LEFT ) { Player . angularDirection = - 1 ; } if ( event . keyCode == KEY_RIGHT ) { Player . angularDirection = 1 ; } if ( event . keyCode == KEY_SPACE && ShootTimer <= 0 ) { ShootTimer += .5 ; playerShoot ( ) ; } }
Function called when key is pressed down
Function called when key is pressed down