| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Social distancing? Try a better way to work remotely on your online files. Dokkio, a new product from PBworks, can help your team find, organize, and collaborate on your Drive, Gmail, Dropbox, Box, and Slack files. Sign up for free.

View
 

PacMan Game - Tutorial 1 - Sprite and Movement

Page history last edited by Steve Sweeney 5 years, 8 months ago

Pac Man Tutorial 1: Choosing a Sprite and Making It Move in Four Directions

Step 1: Choosing Your Sprite

A Sprite is an character or object in your game.  Sprites can move and be active or be props that stay still.  We will choose a Sprite character that will move about your screen.

1. Open Scratch
a. Go to the folder where you copied "Scratch."
b. Double click on the Scratch icon.

2. You will see the opening screen. 



3. Click on the "Costumes" Tab



4. Click "Import"

5. Select a Folder (Animals, People, Things)



6. Choose a Sprite! (Double Click)



Step 2: Making Your Sprite Move in 4 directions (Right, Left, Up, Down)
 

 

7.  Click on the "Scripts" Tab
8.  You want your Sprite to move to the right. Click the "Control" Button



9. Left Click and hold "When 'space' pressed" command and drag to the Scripts window.




10.  Click on the word "space" and select "right arrow." (We will make Sprite move right)



11. Click on the "Motion" button and drag "point in direction 90" over to the Scripts window.



12. Connect the "point in direction" tile to the "When 'right arrow' pressed" command.



13. Click the "Move 10 steps" tile and drag over to the Scripts window.



14. Connect "Move 10 steps" to the "point in direction" tile.



15. Press the right arrow on the computer and watch your sprite move to the right.

16. Making your sprite go left:  Drag the "When 'space' pressed" tile to the scripts window.






17. Drag "point in direction 90" over to the Scripts window. Connect to the "When 'space' pressed." tile.



18. Change the 'space' to 'left arrow.'  Change the '90' to '-90' to make the sprite face left:



19. Drag the "Move 10 steps" tile to the scripts window and connect to the 'left arrow' script.



20.  Now your left arrow will work!  Click the "just flip left-right" icon to make your sprite face in the correct directions.



21. Making your sprite move down: Drag and connect the following tiles:
a. "When 'space' pressed
b. "point in direction '90'"
c. "move 10 steps"



22. Set the direction to down:
a. Change 'space' to 'down arrow'
b. Change '90' to '180'



23.  Your down arrow should work!

24. Make your sprite move up: Drag and connect the following tiles:
a. "When 'space' pressed
b. "point in direction '90'"
c. "move 10 steps"



25. Set the direction to up:
a. Change 'space' to 'up arrow'
b. Change '90' to '0'



26. Now your Sprite should be able to move in all 4 directions!  Test your program by moving your Sprite about the screen.
27. Rename your Sprite as "Eater."
28. Save your work!  Click "Save" and name your file.

 

Pac Man Game - Tutorial 2 - Sense the World and Eat Items



Comments (0)

You don't have permission to comment on this page.