Friday, October 20, 2017

Mouse Game

The game consists of a mouse that wants to get to the cheese, but there is a cat on the stage also, so it has to escape from the cat and get to the cheese.

The stage has blue barriers that block the mouse and the cat to go freely through the stage.


How does this programm work?

The mouse


The mouse moves following the mouse pointer, the script consists of a comination of commands that say to the mouse, that it should move five steps while pointing the mouse pointer. If the mouse pointer is on top of the mouse, it will stop moving. To stop the mouse from moving though the walls, we made a programme commanding the mouse to move -5 steps while it's toching the color blue. When the mouse touches the cat, it dies. This changes the backdrop to the 'Game Over' backdrop. When it recives 'mensaje1' or '2', it hides and stops the program.


This is what makes the mouse move and show when the game is restarted, also it goes to the same place as before when the game starts. The size is set to 40%, because the original size was to big.

This is what makes it detect if the cat is touching it, if so it broadcasts 'mesaje1'.

This makes the mouse detect color, so it can't go through the blue walls.

Here we made a little animation, so when the mouse is moving you can watch it walk.

This makes the mouse receive '2' and then the game stops, because you've won.

This makes the mouse receive 'mensaje1' and then the game stops, because the cat's eaten you.

The cheese

The cheese dissapears when the mouse it's toching it. After that, it changes the backdrop to the 'You won!' backdrop and broadcasts '2'.


This makes the cheese show when the game is restarted, and it goes 1 layer back in case it was over the mouse, that would be unnatural.

First, this sets the size of the cheese to 40%, then it makes it always check if the mouse is touching it, when that happens, it hides and switches the backdrop to 'fondo1', which is the one that says 'You won!', then it broadcasts '2'.

This makes the cheese hide when it receives 'mensaje1'.

The cat

The cat moves randomly through the white areas. When it recives 'mensaje1' or '2', it hides. It can't go through the walls, because it detects the color blue.


This makes the cat go to the same place as before when the game restarts, it sets the size of it to 40% and makes it show. We've made it so it points in 90 degrees, because then it will turn randomly. This makes it also move constantly (forever [move 5 steps]).

This makes it hide when it receives 'mensaje1'.

This makes it turn to a random direction everytime it touches the blue color. The directions are 90, 180 and 270 degrees. 

This makes the cat hide when it receives '2'.

So, there are all the commands for you to explore and analyze, here you have a little mind map to clear things out a bit.





















See it as much as you want, here you have also a collage of the game.



Thanks for reading!

No comments:

Post a Comment