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.
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.
10
.-5
), making the clone smaller.-10
. This will create a rainbow effect.0.1
. Remember that computers work very fast.The finished script will look like the following screenshot:
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.
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
.
0.1
.0.01
.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.18.119.19.174