SET
If we can teach you to create a game just like this one in
15 minutes
what do you think?
Ok, Ok maybe we lied. We will create
a simpler version of this maze game in the next step. |
|
Getting to know the Scratch Project Editor
Add comments to your code can help others to learn about your code, also remind yourself
If you forgot how to do it, check out the video below, or check with your teammates.
Maze game
|
|
Step by Step instruction
Create a maze at mazegenerator.net
|
Go to scratch.mit.edu create an account
|
Import the maze into your scratch project, click on the "costumes" tab to resize the maze
|
Use the shrink tool on the top right corner of your stage to shrink the cat
|
Create script for right arrow control
|
Duplicate the function 3 times, change key controls to "left" "up" "down"
|
Change the motion "change x by ..." to "change y by ..." for up and down arrows
|
Change the value for the above motion to "-2" for left, "2" for up, and "-2" for down
|
Set starting position by adding motion control:
go to x... y... This code make sure each time you start the game, the character will be at the entrance of the maze. |
Add sensing control to detect maze walls. If the character is touching the walls, cancel out the movement changing the movement direction to opposite direction.
Duplicate the same for all four arrow controls. Make sure to change y direction for up and down arrows. |
Add graphic / sprite for the end of the maze, name it END
|
Add finishing touch
Add if...then control Add "touching " sensing to the if...then control Select "END" from drop-down menu Assign a function (example, say YEAH for 2 secs + trun 15 degrees forever) |