HTML and CSS Reference
In-Depth Information
If the player has lost, the state changes to
GAME_STATE_PLAYER_LOSE
; if the player has won,
it moves to the
GAME_STATE_PLAYER_WIN
state. If neither of those has occurred, the game is
set to
GAME_STATE_WAIT_FOR_PLAYER_MOVE
. This starts the game loop iteration over, and the
player begins her next turn.
GAME_STATE_PLAYER_WIN
If the player wins, the
maxEnemy
is increased for the next game. The player's
score
is also
checkedagainstthecurrentsessionhighscoretodeterminewhetheranewhighscorehasbeen
achieved. This state waits for a space bar press and then moves to the
GAME_STATE_NEW_GAME
state.
GAME_STATE_PLAYER_LOSE
The player's score is checked against the current session high score to determine whether a
newhighscorehasbeenachieved.Thisstatewaitsforaspacebarpressandthenmovestothe
GAME_STATE_NEW_GAME
state.