Ejemplo n.º 1
0
        public void enterBattle(PlayerModel player, EnemyType enemyType)
        {
            playerModel = player;
            enemyModel = EnemyFactory.fromType(enemyType);

            initBattleViews();
            enemyAI = new EnemyAI(enemyModel, playerModel);
            initQueues();
        }
Ejemplo n.º 2
0
        private void endBattle()
        {
            Messenger.Broadcast(BattleEvent.END_BATTLE);
            enemyAI = null;

            //TODO make sure this is not called multiple times

            if (playerModel.isDead())
            {
                battleView.defeat();
            }
            else if (enemyModel.isDead())
            {
                battleView.victory();
            }
        }
Ejemplo n.º 3
0
 private void teardown()
 {
     // Clean Up and reset Everything
     if (battleView)
         Destroy(battleView.gameObject);
     enemyAI = null;
 }