HTML and CSS Reference
In-Depth Information
function runGame(){
currentGameStateFunction();
}
function switchGameState(newState) {
currentGameState = newState;
switch (currentGameState) {
case GAME_STATE_INIT:
currentGameStateFunction = gameStateInit;
break;
case GAME_STATE_WAIT_FOR_LOAD:
currentGameStateFunction = gameStateWaitForLoad;
break;
case GAME_STATE_TITLE:
currentGameStateFunction = gameStateTitle;
break;
case GAME_STATE_NEW_GAME:
currentGameStateFunction = gameStateNewGame;
break;
case GAME_STATE_WAIT_FOR_PLAYER_MOVE:
currentGameStateFunction = gameStateWaitForPlayerMove;
break;
case GAME_STATE_ANIMATE_PLAYER:
currentGameStateFunction = gameStateAnimatePlayer;
break;
case GAME_STATE_EVALUATE_PLAYER_MOVE:
currentGameStateFunction = gameStateEvaluatePlayerMove;
break;
case GAME_STATE_ENEMY_MOVE:
currentGameStateFunction = gameStateEnemyMove;
break;
case GAME_STATE_ANIMATE_ENEMY:
currentGameStateFunction = gameStateAnimateEnemy;
break;
case GAME_STATE_EVALUATE_ENEMY_MOVE:
currentGameStateFunction = gameStateEvaluateEnemyMove;
break;
case GAME_STATE_EVALUATE_OUTCOME:
currentGameStateFunction = gameStateEvaluateOutcome;
break;
case GAME_STATE_ANIMATE_EXPLODE:
currentGameStateFunction = gameStateAnimateExplode;
break;
case GAME_STATE_CHECK_FOR_GAME_OVER:
currentGameStateFunction = gameStateCheckForGameOver;
break;
case GAME_STATE_PLAYER_WIN:
currentGameStateFunction = gameStatePlayerWin;
break;
case GAME_STATE_PLAYER_LOSE:
currentGameStateFunction = gameStatePlayerLose;
break;
Search WWH ::




Custom Search