HTML and CSS Reference
In-Depth Information
Geo Blaster Global Game Variables
Now let's look at the entire set of game application scope variables needed for our game.
Variables that control screen flow
These variables will be used when the title and “Game Over” screens first appear. They
will be set to true after the screen is drawn. When these variables are true , the screens
will look for the space bar to be pressed before moving on to the next application state:
var
var titleStarted = false
false ;
var
var gameOverStarted = false
false ;
Game environment variables
These variables set up the necessary defaults for a new game. We will discuss the ex-
traShipAtEach and extraShipsEarned in the section Awarding the Player Extra Ships :
var
var score = 0 ;
var
var level = 0 ;
var
var extraShipAtEach = 10000 ;
var
var extraShipsEarned = 0 ;
var
var playerShips = 3 ;
Playfield variables
Thesevariablessetupthemaximumandminimum x and y coordinatesforthegamestage:
var
var xMin = 0 ;
var
var xMax = 400 ;
var
var yMin = 0 ;
var
var yMax = 400 ;
Score value variables
These variables set the score value for each of the objects the player can destroy:
var
var bigRockScore = 50 ;
var
var medRockScore = 75 ;
var
var smlRockScore = 100 ;
var
var saucerScore = 300 ;
Search WWH ::




Custom Search