Friday, October 20, 2017

Cat and Mouse Report


In this post we will explain you how we scripted our work.
You have to know that every scratch startes with the green flag.

Mouse:
We had to make it follow the mouse-pointer, so it points toward to the mouse pointer and moves three steps. It follows the mouse-pointer in a specific speed.
It shows at the beginning of the maze.
If it touches the blue wall, it goes to its starting position. But if the cat (other script) touches, the backdrop switches, the mouse hides and other scripts stop. You lose. When the backdrop switches to blue sky3, it means you won. we will explain it better in the cheese explanation (other script). Finally, as you can see, we created a variable called food. It start in cero and once you reach five foods, the backdrop switches to blue sky3.
On the right side, there is a script that makes the mouse glide to the middle of the backdrop when you win (when the backdrop switches to blue sky3).
When the mouse gets near the mouse-pointer, it moves back and forth. We solved that problem by putting two operators, distance to block, if then block and wait until block. And to make the mouse move, it has to be in a bigger distance to the mouse-pointer than 4.

Cat:
When you click the green flag the backdrop switches to backdrop1 (maze). The cat goes to a specific position and points to a specific direction, because of the blocks “go to” and Point in direction”. It hides, so that the mouse has time to start moving and then it shows 2.5 secs later.
The cat moves 3 steps forward, a little bit faster than the mouse, and if it touches an edge, it bounces. If it touches the mouse, the mouse loses, the backdrop switches to moon (loser backdrop) and it stops all other scripts in this script.
This was a challenge for us, because we had to make the cat bounce on the blue walls of the maze. So if the cat touches a wall, it will move 3 steps back, will turn 90, 180 or 270 degrees right and will continue moving forward.
On the right there are two simple scripts, in both the cat should hide, if the backdrop switches.

Cheese:
When you click the green flag, the cheese shows in a random position. If it touches an edge it bounces, but this cheese, in comparison to the other sprites, doesn’t move.
If the mouse touches the cheese, the cheese will hide, the food-counter will change by one, the cheese will go to a random position and it will show again.
And if the food is bigger than four, the backdrop will change to blue sky3 (Win backdrop), it waits 1 second before stopping all, to make the gliding of the mouse to the middle of the backdrop.
As well as in the cat, it has to hide every time the backdrop changes, so that it not shows.

Sprites:
Mouse
Cat
Cheese

Backdrops:
Maze
Game Over
You Won

wordcloud.png


No comments:

Post a Comment