Game Development Reference
In-Depth Information
6. Ater compleing the formula, we just have to check whether the sprite is on edge
and bounce if this is the case (using if on edge, bounce ). The finished script will look
like the following:
7.
Double-check how the sine formula is assembled. If these blocks are mixed up and
are running in the wrong order, we might get strange results. The calculaions start
from the inner blocks and progress towards the outer blocks.
Objective complete - mini debriefing
This concludes our last atack patern. We used a sine wave formula to create a smooth,
waving patern for our boss sprite. Now we can fully test the boss enemy's movement.
Let's test it a few imes to see how it looks. If desired, you can experiment with the diferent
values for the movement paterns. The sine wave can especially change a lot if you play
around with the numbers for a bit. Just keep in mind the previous explanaion to esimate
what changing a certain number will do to the wave.
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 sill looks a bit too plain for a boss creature; let's ix this with
some visual spectacle.
 
Search WWH ::




Custom Search