HTML and CSS Reference
In-Depth Information
//Draw Missiles
for
for ( var
var i = missiles . length 1 ; i >= 0 ; i −− ) {
context . drawImage ( missileImage , missiles [ i ]. x , missiles [ i ]. y );
}
//draw aliens
for
for ( var
var i = aliens . length 1 ; i >= 0 ; i −− ) {
context . drawImage ( alienImage , aliens [ i ]. x , aliens [ i ]. y );
}
//Draw Player
context . drawImage ( playerImage , player . x , player . y );
Aswestated previously, SpaceRaiders isnotafullgame.Wehaveimplemented onlyenough
to get the player to shoot missiles so that we can play the shoot sound and to detect collisions
so that we can play the explode sound.
Search WWH ::




Custom Search