Cat and Mouse is a type of game that involves constant pursuit and near captures, and is based on how a cat hunts a mouse in real life. The cat will constantly chase the user's mouse pointer until it has been caught or the game has been stopped.
The most used variants of cats are the Scratch Cat [1] and the Cat 2 sprite.[2][3] A common mouse sprite is the Mouse 1 sprite[3][2] The repeat until block can be used to continue moving until the mouse pointer is reached:
when green flag clicked go to x: (0) y: (0) repeat until <touching (mouse-pointer v)?> point towards (mouse-pointer v) move (2) steps end
Additions
A common method of score tracking is by the amount of time has transpired. This can done using the timer:
when green flag clicked set [score v] to (0) reset timer repeat until <touching (mouse pointer v)?> set [score v] to (timer) end
Another method of score tracking and winning is using a variable timer. Make an empty sprite with two costumes: one blank (costume 1) and one with a "Win" banner (costume 2).
when green flag clicked switch costume to (costume 1 v) set [Time v] to (0) forever wait (1) seconds change [Time v] by (1) if <(Time) > [20]> then broadcast (Win v) stop [all v] end end when i receive [Win v] switch costume to (costume 2 v)
The Mouse addition: (add a mouse sprite)
when green flag clicked set size to [50]% forever go to (mouse-pointer v) point in direction (-45) // Direction you want it to be facing. This is around the direction of most cursors. end
Note: For the Mouse addition, in the main cat sprite, change the "touching" and "point" to "Mouse" instead of "Mouse-Pointer"
Variations
Common variations of the Cat and Mouse game are: [1]
- Adding high scores using ☁ cloud data
if <(Score) > (Highscore ☁)> then set [Highscore ☁ v] to (Score)
- Adding achievements, such as coins or other virtual currencies which can be used to purchase other items in it
- Adding sound effects or banners and text for certain events such as scoring and loss[1]
- Adding obstacles that the cat must maneuver around
- Adding obstacles that the mouse must maneuver around
- A mouse pointer. Probably a mouse.[1]
- Other characters, such as a dog going after a bone mouse pointer[4].
- Make the mouse have to get to a certain area on the screen[5]