Game Development Reference
In-Depth Information
Objective complete - mini debriefing
The boss now shows an impressive colorful tail while moving. Since the clones don't actually
move but shrink over ime, they show a trailing path behind the boss sprite.
Classified intel
To give the visual efect some kind of funcion 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 efect. All that is needed is to shorten the pause ime
so the clones are generated closer together. Instead of a ixed number we add a calculaion
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 calculaion inside the wait () secs slot.
6.
Now, as the hitCount variable grows, the wait ime 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 batle and see the efect.
 
Search WWH ::




Custom Search