UpdateTargets Flashcards
1
Q
What is the purpose of this for loop?
for (int Count = 0; Count < Targets.Count - 1; Count++)
{
Targets[Count] = Targets[Count + 1];
}
Targets.RemoveAt(Targets.Count - 1);
A
Moves all targets one step left, removing the front-most target from the game board visually.
2
Q
How are new targets added ?
A
In training mode, we recycle the final item.
Targets.Add(Targets[Targets.Count - 1]);
In random mode, we generate a fresh random target.
Targets.Add(GetTarget(MaxTarget));
3
Q
What is the purpose of this funtion?
A
Keeps the “conveyor belt” of targets moving. Called once per turn if we haven’t ended the game.