HTML and CSS Reference
section Applying Collision Detection for a detailed discussion of this topic.
Createsa playerMissile objectatthecenteroftheplayershipandfiresitinthedirection
the player ship is facing.
Creates a saucerMissile object at the center of the saucer and fires it in the direction of
the player ship.
Creates an explosion for the player by calling createExplode() , as well as changing the
game application state to GAME_STATE_PLAYER_DIE .
Accepts inthelocation fortheexplosiontostartandthenumberofparticles fortheexplo-
Determines whether the rectangular box that encompasses an object's width and height is
overlapping the bounding box of another object. It takes in two logical display objects as
parametersandreturns true iftheyareoverlappingand false iftheyarenot.Seethesec-
tion Applying Collision Detection for details about this function.
Accepts in the scale and x and y starting points for two new rocks that will be created if a
large or medium rock is destroyed.