Game Development Reference
In-Depth Information
// Call the bossDied event and give it a score of
// 1000.
if(bossDied != null)
bossDied(1000);
transform.position = inActiveNode.transform.position;
currentEvent = BossEventController.bossEvents
inactive;
timeForNextEvent = 0.0f;
enemiesLeftToKill = enemiesToStartBattle;
}
void enemyDied(int enemyScore)
{
if(currentEvent == bossEvents.inactive)
{
enemiesLeftToKill -= 1;
Debug.Log("--- Enemies left to start boss battle:
" + enemiesLeftToKill);
if(enemiesLeftToKill <= 0)
beginBossBattle();
}
}
}
Now that indeed was a bit of codeā€”lots of good stuff in there though, and lots
that you should now recognize! Let's go through and review some of the
important elements.
Note that at the very beginning, we create a new event for bossDied . This is exactly
the same as our normal enemyDied event, which is used to track the change in scores.
This would be a perfect opportunity for you to expand on the
boss battle by making use of the existing events that the enemies
have. Evoke them to react when the boss dies! Make them angry!
Make it so that a swarm of enemies spawn out of anger! Have
fun with it because those tanks are mad!
 
Search WWH ::




Custom Search