Lesson 2
-
Check out the code in the projects below by going to the links and
pressing -
Created during meeting (far from finished): https://scratch.mit.edu/projects/177119376/
Basic Game
-
There’s a maze the player has to navigate and get to the end, but there’s a ghost that randomly floats around. If it touches the player, they lose.
-
Teaches:
-
Sprite movement using arrow keys
-
x/y coordinate system of the game screen
-
“Pick random” block
-
(if) “touching ___” block
-
-
Draw a maze
-
Go to the backdrops tab once the background is selected
and use the tools to draw a maze. Make sure all of the
walls are the same color.
-
-
Make the main character
-
Resize it so it fits within the walls of your maze
-
Program it to move via arrow keys
-
Use the different starting block “If ___ key pressed”, “change x (or y) by ___”. There should be 4 of these for the 4 directions of movement.
-
Explain the x- and y- graph to kids so they understand the x- and y- directions.
-
-
Check for walls
-
In each of the 4 movement scripts after the movement, check if the sprite is touching the wall color. If it is, reverse the movement.
-
-
-
Make a prize at the end of the maze so that if the character gets to it, it wins.
-
This uses the same concept as the losing screen from Lesson 1!
-
-
Make a ghost
-
Use a forever loop to keep it moving and checking if it is touching the main sprite (same concept as last lesson!)
-
Use the “glide ___ seconds to x: ___ y: ___”, put “pick random” blocks in each blank
-
Find the coordinate limits of the game screen by putting the mouse at the very edges of the game screen. The bottom right of the game screen shows the mouse pointer’s x- and y- coordinates.
-
-
Creepy Maze
It's easier to draw a maze quickly and project it to the class, so that the kids have inspiration for their mazes.
-
Make a second level- a more complicated maze appears when the player beats the last one.
-
Add sound. The model game has wolf howls at random intervals.
-
Make the ghost face the main character as it floats around. Make the main character face the direction of travel.
-
Make the lights flash off randomly. This can be done with a sprite that’s a black rectangle the size of the screen. It shows up randomly for a few seconds before being hidden again.
Challenges
Scratch is developed by the Lifelong Kindergarten
Group at the MIT Media Lab. See http://scratch.mit.edu.