Before we dive into the excitement of creating the boss enemy, let's first do something smart and create a script that helps us to test the boss that we create.
As you may have noticed while testing the game, waiting 90 seconds for the boss to appear is a rather long time. We could just decrease the wait time in the script, but that has a few drawbacks.
It would be more difficult to test the wave phase of the game, since the timer runs for such a short time.
We run the risk of forgetting to change the timer before finally publishing the game.
A better option is to create a separate temporary script that we can throw away when we have finished the game without any risk to all our hard work.
We will add this script to the Stage sprite. This is often the best place for these kinds of control scripts.
When a certain button is pressed, we will change the ordinary flow of things, as follows:
1
and 30
respectively. This way, we fake having scored some points during the game, so we can see the effects of the upgraded spear on the boss.The final script will look like the following screenshot:
This is all that is absolutely necessary for this script. As you can see, the timer is still running and will eventually reach 90. This would cause the boss message to be called again. We don't want that as it could cause strange results. So, we will take a few precautions to prevent the timer from ever reaching 90.
Stopping the timer altogether would be a great option, but unfortunately Scratch doesn't allow that. The precautions to be taken are as follows:
80
.0
.After we start a new game, we can press the B key to immediately jump to the battle against the boss. We make sure the spear has some random upgrades so that we can see the effect. We also make sure the timer that's set for the usual game flow doesn't bother us.
We can now quickly skip to and test the boss fight without first having to play through a wave of enemies.
18.117.188.138