Game Development Reference
In-Depth Information
The steps to perform this test are as follows:
Click on the target sprite so you can view its scripts.
Add a repeat unil () block at the start of the clone script.
Inside the repeat unil loop place a change y by () block and ill in a negaive
number to make the targets move down.
I filled in the number -4 for a fairly slow speed. You may take bigger steps, but then
the targets could end up being stuck partly through the landscape. Not a big issue,
but it might not look as nice.
To stop the targets from moving when they reach the landscape, add a touching
color ()? condiion to the repeat unil () block.
Click on the color box and then point and click on the green line that you've drawn.
Computers are very precise about color. Keep this in mind if your color collision doesn't
work. Most likely, the actual color of the object will be slightly different from the color that
you checked for. You can't see it with the naked eye, but the computer can tell the difference
based on the color number. The finished script should look like the following screenshot:
As a final step, change y: 0 to y: 180 in the other target sprite script. This will place the
target at the top of the stage and make sure that it doesn't end up inside or underneath
the landscape.
Search WWH ::

Custom Search