-
Check out the code in the project below by going to the links and
pressing -
This game is continued in Lesson 5, because it takes longer than 1.5 hrs.
Basic Game
-
The player slides a basket left and right on the bottom of the screen and catches cats as they fall from the top of the screen. Catching the crabs decreases the score, while catching cats increases it.
-
Teaches:
-
Cloning
-
Making sprites fall/go from one side of the screen to the other
-
-
Make a basket that follows the mouse, but only in the x position. Use the “go to x:___ y: ___” block, and in the space for x put in the “x position” bubble found under the dark blue “Motion” tab of blocks.
-
Make a sprite that falls from the top of the screen to the bottom, then goes back up to the top of the screen at a random x position and falls again.
-
2 methods:
-
Constantly change the sprite's y- position and
check if it hit the ground or the basket in the same loop -
Parallel process- use the "glide to___" block in one
script, and constantly check if the sprite hit the ground
or the basket in a separate script
-
-
-
Make a variable that counts how many times the falling sprite
gets caught by the basket. -
Make a few clones of the falling sprite. The cloning blocks are
found under yellow “Control” blocks tab.-
Warn the kids about putting the “Make clone of myself”
block in a forever loop unless the clones are being deleted
somewhere else! The game will lag and crash! -
Program the clones with the “When I start as a clone” start
block. Give them the same script as the falling sprite, so
they all fall.
-
-
Make another falling sprite with all the same scripts as the first one. This will be the “crab”, or the one that will make the player lose points if it catches it.
Lessons 4/5
-
Add backgrounds and/or sound
-
Make it possible for the player to win/lose based on their score
Scratch is developed by the Lifelong Kindergarten
Group at the MIT Media Lab. See http://scratch.mit.edu.
Raining Cats and Crabs
Challenges
Raining Cats and Crabs Game
Another cloning method is taught in Lesson 5. This method uses the "master" sprite (the one making the clones) in the game.
This is the end of Lesson 4- everything up to here took 1.5 hrs.