Bonus Score for shooting all enemies of a wave

Hey!
I’m almost finished with the Laser Defender section and before moving on with the course, I wanted to try some additional stuff that crossed my mind while working through the videos.

Would be great to get some help with this situation…
I thought about a bonus score for each wave if the player has shot every enemy of a wave.
Not quite sure about a cool approach to achieve that.
We would have the “numberOfEnemies” from the WaveConfig script, so kind of a counter that increases with every defeated enemy and which resets itself (or is turned back to zero at the end of every wave) would be cool I guess and to compare the values then. If the value is the same, the bonus score is triggered.
Yep but I’m a bit overwhelmed where to start and which scripts etc.
Would be great to read some ideas…

1 Like

Hi Nursey,

Welcome to our community! :slight_smile:

Your idea sounds interesting, and with the knowledge you gained in this and the past sections, you should be able to implement it.

As you said, we know the “numberOfEnemies” from the WaveConfig object. Since we spawn one enemy after another, we know when we spawned the last enemy.

What exactly is your idea? How does it work? Is the bonus associated with an enemy or is it associated with the wave?

If it’s associated with the enemy, you could add a new int variable in the Enemy class and assign the bonus to it.

If the bonus is associated with the wave and stacks with each enemy that was destroyed, you could write a Game class where you keep track of the current bonus.

The best would be to take a pen and a sheet of paper and note down what is supposed to happen. Then draw the logic in a diagram. And the last step is to break the whole concept down into single, manageable task. Once you did that, all you have to do is to complete and test each task. And when you are done, your idea should theoretically work.

Just start! Log values and messages into your console. :slight_smile:

Hey Nina!
Thanks for your quick and detailed reply!
Will try to work it out this weekend. I think I have an idea now how it could function :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms