Example #1
0
 private void update()
 {
     CMouse.update();
     CKeyboard.update();
     mState.update();
     if (mState is CLevelState)
     {
         if (mState.getState() == CLevelState.FINISHED)
         {
             setState(new BattleState());
             return;
         }
     }
     else if (mState is BattleState)
     {
         if (mState.getState() == BattleState.PLAYER_WON)
         {
             //GIVE player rewards.
             BattleData.lastBattleOutcome = BattleData.BattleOutcome.WON;
             BattleData.battlesWon++;
             setState(new CLevelState());
             return;
         }
         else if (mState.getState() == BattleState.PLAYER_LOST)
         {
             //GAME OVER
             BattleData.lastBattleOutcome = BattleData.BattleOutcome.LOST;
             BattleData.battlesWon++;
             setState(new CLevelState());
             return;
         }
     }
 }
Example #2
0
 private void update()
 {
     CMouse.update();
     CKeyboard.update();
     mState.update();
     mCamera.update();
 }