build a basic maze in scratch (v1)

18
Build a basic maze in Scratch Prepared by Joy Suliman for SLQ

Upload: joysuliman

Post on 29-Nov-2014

1.463 views

Category:

Education


2 download

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.

TRANSCRIPT

Page 1: Build a basic maze in scratch (v1)

Build a basic maze in Scratch

Prepared by Joy Suliman for SLQ

Page 2: Build a basic maze in scratch (v1)

Create the hero

Delete the cat New sprite Choose a sprite

from the file Position it on

stage Resize (shrink/

grow) Rename it hero

Page 3: Build a basic maze in scratch (v1)

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

Page 4: Build a basic maze in scratch (v1)

Create the maze background

Stage / Backgrounds

New Background: Paint

Select paint bucket tool

Choose colour and fill

Page 5: Build a basic maze in scratch (v1)

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

Page 6: Build a basic maze in scratch (v1)

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

Page 7: Build a basic maze in scratch (v1)

Create the prizes Select new sprite

from folder, position, resize

Rename Create the code Duplicate the sprite

with stamp Position, resize,

rename new sprites

Page 8: Build a basic maze in scratch (v1)

Create the maze background Stage /

Backgrounds New Background:

Paint Select paint bucket

tool Choose colour and

fill

Page 9: Build a basic maze in scratch (v1)

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

Page 10: Build a basic maze in scratch (v1)

Keeping score Create a variable

called “score” for all Select hero Set score to 0

Select prize Change score by 1

Page 11: Build a basic maze in scratch (v1)

Simple you win Select hero When flag clicked Forever If Score = 3 Say winner!!

Page 12: Build a basic maze in scratch (v1)

Want to add more levels?

We'll need to create a new set of variables and put them into action

So watch carefully . . .

Page 13: Build a basic maze in scratch (v1)

  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

Page 14: Build a basic maze in scratch (v1)

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

Page 15: Build a basic maze in scratch (v1)

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

Page 16: Build a basic maze in scratch (v1)

A bit of tidying up . . .

  Select the hero   Add these two bits of

code

Page 17: Build a basic maze in scratch (v1)

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

Page 18: Build a basic maze in scratch (v1)

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.