Game Development Reference
In-Depth Information
6.
Click on the Make a Block buton, as shown in the following screenshot:
7. A pop up will show where we can name the new funcion block. Let's name it
findStartPosition .
8. We don't need opions. So just click on OK to create the new funcion block.
Note how a new staring block (with a curved top) will appear called indStartPosiion . This
is the start of the script where we can write all the steps the funcion should take as shown
in the following screenshot:
We want to place the cat in an open hallway and not in a wall. To test if the cat can move to
a certain posiion, we will move it and check if it then collides with a wall. If it does, we will
move it another ile segment and test again. We repeat this process unil we can place the
sprite. Now perform the following steps:
1.
Make a list for this sprite, called xySave , to store the coordinates. This list will be
used later to help move the sprite.
 
Search WWH ::




Custom Search