Game Development Reference
In-Depth Information
6. As long as we will collide with the black walls, we will set the change x by (-20) block
to move the sprite on the left-hand side.
7. After it has found a free space, we can set the show block the sprite:
Do these steps look familiar? They should. It's efecively the same script as the cat is using
in the findStartPosition funcion, barring the use of the list. Since the exit ile doesn't
move, we don't need to save its posiion.
To let the player know when he or she has reached the exit and has won this (part of a)
game, we add some feedback to the cat sprite. We will add a few addiional acions to the
takeStep funcion as follows:
1. At the end of the funcion, add an if () then statement to make a check ater each
ime the cat moved.
2. We will check if the cat has reached the exit point with the help of the touching
<exit> ? block.
3. If the cat responds, it will show (Yay! On to the next level.) and set the for (2) secs
block.
4. After that, we will set the broadcast <createMaze> block to trigger the drawing of a
new maze. This will also trigger the cat and allow the exit to reset as follows:
This is staring to feel more like a game already.
 
Search WWH ::




Custom Search