예제 #1
0
 private void decrementLife(CellPosition cause) {
   if (lifeCount > 0) {
     lifeCount--;
     gameEventManager.notifyAll(new GameStatEvent(GameEvent.EventType.LIFE_LOST, cause, -1));
   } else {
     gameEventManager.notifyAll(new GameStatEvent(GameEvent.EventType.LIFE_LOST, cause, -1));
     gameEventManager.notifyAll(new GameLifecycleEvent(GameEvent.EventType.GAME_OVER));
   }
 }
예제 #2
0
  public SurvivalLifeUpdater(Activity activity) {
    super(activity);

    gameEventManager = GameEventManager.getInstance();
    lifeCount = 3;
    updateText(getLifeAsString());
  }