- Let's make the mouse run!
- Every time the cat touches the rat, the rat will move to a random position.
Junior Coders : The Cat Chase
Chase the Mouse
- Here's a hint! Attach a
foreverloop to when green flag clicked.
if < > thenin it to check if the cat is touching the mouse anytime.
touching [Mouse v] ?as your operator.
- When it touches the mouse, use
broadcast [chase v]message
- Now, to tell the mouse to run away, use
When I receive [chase v]
pick random () to ()with go to x:() y:()to make it run away to a random position.
- Make sure the mouse can run the farthest it can get within the stage.
- To do this, what is the minimum and the maximum x and y coordinates the mouse can reach?
- Once you're done, click the green flag and chase the mouse.
- The mouse should be able to run away!