Click here to load reader

Build a basic maze in scratch (v1)

  • View
    1.458

  • Download
    2

Embed Size (px)

DESCRIPTION

This is a step by step tutorial for a maze game in scratch which has a hero controlled with the arrow keys, maze, levels, win and lose scenarios.

Text of Build a basic maze in scratch (v1)

  • 1. Build a basic maze in Scratch Prepared by Joy Suliman for SLQ
  • 2. Create the hero Delete the cat New sprite Choose a sprite from the file Position it on stage Resize (shrink/ grow) Rename it hero
  • 3. Moving your hero Select hero When up arrow key pressed Point in direction 0 Move 10 steps Duplicate with stamp 3 times Adjust values for all directions
  • 4. Create the maze background Stage / Backgrounds New Background: Paint Select paint bucket tool Choose colour and fill
  • 5. Draw the maze Paint new sprite Zoom out Select paint bucket tool Select rectangle tool Draw a few rectangles with spaces between Rename sprite to maze Rename costume to maze1
  • 6. Resetting the hero Select hero When flag clicked Go to x: y: Point in direction 90 Forever if Touching maze Turn 180 degrees Move 20 steps
  • 7. Create the prizes Select new sprite from folder, position, resize Rename Create the code Duplicate the sprite with stamp Position, resize, rename new sprites
  • 8. Create the maze background Stage / Backgrounds New Background: Paint Select paint bucket tool Choose colour and fill
  • 9. Add sound effects Select hero Play drum 39 for 0.1 beats Insert code into reset loop Select prize Play drum 48 for 0.1 beats Insert code, repeat for each prize
  • 10. Keeping score Create a variable called score for all Select hero Set score to 0 Select prize Change score by 1
  • 11. Simple you win Select hero When flag clicked Forever If Score = 3 Say winner!!
  • 12. Want to add more levels? We'll need to create a new set of variables and put them into action So watch carefully . . .
  • 13. Remove the winner script from the shark Create a variable level Add this code to the script for the stage It works by setting the level to the score Setting up the levels
  • 14. Changing the maze Create a new costume for the maze called maze 2 Create a new costume for the maze with a win message called end screen Include this code in the maze scripts
  • 15. New prizes for the new level Draw or import a new prize sprite Create a new costume for the maze with a win message called end screen Include this code in the maze scripts
  • 16. A bit of tidying up . . . Select the hero Add these two bits of code
  • 17. Pimp and personalise your game . . . Animate the hero or prizes Add more levels, see if you can make then harder Set a timer for each level Use the pen scripts so that you hero leaves a trail Create instructions, a start screen and story Add or create soundtrack for your game
  • 18. Want more? Go to the scratch website www.scratch.mit.edu Have a look around, find something you like, check out the code, and see if you can modify it to use in your game.

Search related