Making the boss more impressive

The boss creature is now a serious threat to the player. You can never be sure where it will go next, so it will be difficult to hit. The player runs the risk of bumping into it and prematurely ending the game. The boss still looks a bit too plain for a boss creature; let's fix this with some visual spectacle.

Engage thrusters

We will add a clone script to the basic sprite. Contrary to the starfish clones, this one will not have any in-game effect. It will just be used to make the game look a bit more spectacular.

  1. First, we add a create clone of <myself> block inside the repeat until loop of the when I receive <boss> script. We place it just at the end of the loop.
    Engage thrusters
  2. Then we start a new script with a when I start as a clone block.
  3. Next we add a repeat until () block.
  4. For the condition, we construct size < () (built-in variable from the Looks category) and place it inside the slot; fill in the value as 10.
  5. During each loop, we use change size by () (with value -5), making the clone smaller.
  6. We also use change <color> effect by (), changing its color with value -10. This will create a rainbow effect.
  7. Then we use wait () secs to slow the process down so we can actually see it happening; fill in the value as 0.1. Remember that computers work very fast.

The finished script will look like the following screenshot:

Engage thrusters

Objective complete – mini debriefing

The boss now shows an impressive colorful tail while moving. Since the clones don't actually move but shrink over time, they show a trailing path behind the boss sprite.

Objective complete – mini debriefing

Classified intel

To give the visual effect some kind of function in the game, we can expand the script for it. An easy way is to shorten the tail as the boss creature accumulates more hits. This could show to the player how the enemy weakens as and when it gets hit.

Here is how we could add such an effect. All that is needed is to shorten the pause time so the clones are generated closer together. Instead of a fixed number we add a calculation based on the current hitCount.

  1. We grab the and * operators.
  2. To the left of the operator, we insert a base value of 0.1.
  3. The right slot is filled with the * operator.
  4. The product will be hitCount * (), with value 0.01.
  5. We place this calculation inside the wait () secs slot.
    Classified intel
  6. Now, as the hitCount variable grows, the wait time shortens by 0.01 seconds per hit to be exact. Perhaps this number doesn't show enough of an effect. So feel free to play around with it and try larger numbers.
  7. Start the game. Press B to skip to the boss battle and see the effect.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.19.174