Game Development Reference
In-Depth Information
Add a repeat … block.
Fill in 5 to create five clones per wave.
Insert a create clone of <myself> block.
Then wait for two seconds by using the wait ... secs block so the enemy clones
won't be spawned too quickly.
Before we start moving the clones, we have to determine what path they will follow.
The key informaion here are the points where the path bends in a new direcion.
We can move the enemies from one bend to another in an orderly manner.
Be warned that it may take some ime to complete this step. You will probably need to test
and change the numbers you are going to use to move the sprites correctly. If you don't have
the ime to igure it all out, you can check and copy the image with the script blocks at the
end of this step to get a quick result.
Do you remember how the xy-coordinate system of the stage worked from the last project?
Get a piece of paper (or you can use the text editor on your computer) and get ready to
take some notes. Examine the background you drew on the stage, and write down all the
xy-coordinates that the path follows in order. These points will serve as waypoints.
Look at the screenshot to see the coordinates that I came up with. But remember that the
numbers for your game could be different if you drew the path differently.
To move the enemy sprites, we will use the glide … secs to x: … y: ... blocks. With this block,
a sprite will move luidly to the given point in the given amount of ime as shown in the
following steps:
1. Start the clone script with a when I start as a clone block.
2. Beyond the staring point, there will be seven points to move to. So stack together
seven glide … blocks.
3. In the coordinate slots, fill in the coordinates you just wrote down in the correct
order. Double-check this since filling in a wrong number will cause the enemies to
leave the path.
Deciding how long a sprite should take to complete a segment depends on the
length of that segment. This requires a bit of guesswork since we didn't use an exact
drawing method. Your most accurate informaion is the diferences between the
coordinates you used from point to point.
Search WWH ::

Custom Search