-
Notifications
You must be signed in to change notification settings - Fork 1
Score Counters
This page describes details about the score counters present on the score scene.
The score scene required several different managers in order to create a "chain" of events about UI counters. Their order and meaning are written in the following headers.
In the beginning, the UI panels designed for listing defeated enemy types take a sum of all defeated enemies by all the players and create instances of the UI elements with an enemy sprite if at least one enemy of this type was defeated by any of the active players.
After determining what enemy types have to be counted, the manager responsible for "switching" to the next enemy type goes to the first one and then invokes an event. It is captured by the other manager which counts defeated units.
If reached the last enemy type, then another event is invoked which is captured by the other system loading the next scene depending on the game state.
When the current enemy type was changed to the next one in order, the separate manager designed for counting enemies starts counting one by one appropriate number of times per player.
For example, when the first player destroyed 5 units of the same enemy type and the second player, 3 units, then the same enemy is counted 5 times, all of these times are counted for the first player, but for the second player, only the first 3 times matter.
When counting enemies of the current type was finished, the same manager sends a signal captured by the manager switching enemy type and goes to the next type unless it was the last type to count (then it invokes the other event).
If the 2 player mode was selected, then the manager responsible for awarding the player with bonus points is activated. It compares total defeated enemies by all the active players and determines which player must be awarded for highest effectiveness during the battle.
If both the players are still alive and total number of defeated enemies are different (there is no draw), then the player with highest number of defeated enemies is awarded with 1.000 bonus points.