build a basic maze in scratch (v1)

Post on 29-Nov-2014

1.463 Views

Category:

Education

2 Downloads

Preview:

Click to see full reader

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

Build a basic maze in Scratch

Prepared by Joy Suliman for SLQ

Create the hero

Delete the cat New sprite Choose a sprite

from the file Position it on

stage Resize (shrink/

grow) Rename it hero

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

Create the maze background

Stage / Backgrounds

New Background: Paint

Select paint bucket tool

Choose colour and fill

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

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

Create the prizes Select new sprite

from folder, position, resize

Rename Create the code Duplicate the sprite

with stamp Position, resize,

rename new sprites

Create the maze background Stage /

Backgrounds New Background:

Paint Select paint bucket

tool Choose colour and

fill

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

Keeping score Create a variable

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

Select prize Change score by 1

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

Want to add more levels?

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

So watch carefully . . .

  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

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

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

A bit of tidying up . . .

  Select the hero   Add these two bits of

code

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

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.

top related