Game Development Reference
In-Depth Information
We can test the game now, but someimes the movement of the boss will freeze when the
third atack patern gets selected. We can also test each atack patern separately by just
clicking on the proper script stack instead of running the enire program with the <green
lag> buton.
Creating attack pattern 3
To inish of all the atack moves for the boss, let's create a third atack patern script.
Prepare for lift off
For this atack patern, we are going to use an interesing mathemaical formula called a
sine wave . You might recognize this patern from mathemaics or from a radio wave readout.
This patern causes the sprite to move up and down in a regular curved wave patern.
It looks very good and can be quite hard to dodge if you're not careful. It serves as a perfect
"killer" move to close this part of the tutorial with.
Engage thrusters
This third atack patern script starts and closes in exactly the same way as the other two.
We start with receiving the message pattern3 and close by picking a new random patern
from the list, as follows:
1. For this patern, we also use set rotaion style <let-right> , since it looks beter
when the sprite is facing straight ahead.
2. We then use glide 1 secs to x: () y: () and set it to the middle-right corner of the
screen, filling in the values 170 and 0 respecively. This will be the staring posiion.
Search WWH ::

Custom Search