Games design - Scratch script examples


Scratch script examples

Start & end games

End a game

Start a game - simple method

Start and end a game - recommended method

Game instructions screen

Start and game over screens

 

Control a sprite's movement

Follow the mouse-pointer - make a sprite follow/chase the mouse-pointer

Arrow keys - beginners - move a sprite around the stage with the Arrow keys

Arrow keys - intermediate - move a sprite around the stage with the Arrow keys

Arrow keys - advanced - move a sprite around the stage with the Arrow keys

Stick to mouse - make a sprite stick to and move with the mouse

Drag a sprite - make a sprite draggable

Jumping

Platform jumping - make a sprite fall unless it is riding on top of another sprite

Continuous movement - make a sprite reappear on the opposite edge when it leaves the screen

 

Automatic sprite movement

Random stage location - make a sprite start from random x and y locations on the stage

Random movement - sprites move on their own

Continuous movement - make a sprite reappear on the opposite edge when it leaves the screen

Bounce - make a sprite bounce

Random falling - make sprites fall randomly

Following - make one sprite follow another

Following using "Distance to" - make one sprite follow another when they get close

Make an object move by itself through a maze

Run away - Make one sprite run away from another

 

Vehicle control

Car - control and steer

Tank and tank turret

Follow mouse - make a sprite follow/chase the mouse-pointer

Stay on a track - make a car that is following the mouse stay on a track/path

 

Stay on a path

Stay on a track/path simple - make a sprite (such as a car) that is following the mouse stay on a track/path

Keep a character on a path - make a character stay on a path (such as in a maze)

 

Stage

Change the stage background

 

Costumes & looks

Change costume

Choose costume randomly from a range of costumes

In front & behind - make a sprite appear in front of or behind other objects

Fade in and out - make a sprite fade in and out

 

Touching (collisions)

Touching (collisions)

Distance to - make one sprite follow another when they get close

Hide when touched - hide a sprite when it is touched

 

Repeat loops

Repeat a fixed number of times, and Repeat until

 

Throw & Fire

Fire or throw in 1 direction (eg up, down, left or right)

Fire or throw in the direction of the mouse pointer

Fire or throw by clicking the mouse

Fire or throw in the direction of another sprite

Have an enemy move and fire automatically at you

Fire or throw in the direction your character is facing

 

Pick up and put down an object

Pick up, carry and put down an object

 

Sports

Dribble & shoot

 

Switches

Toggle switch

 

Random

Make something move randomly

Makes an object (ball ) appear and fall randomly

 

Spawning

Random spawning

 

Timers & clocks

Clock

Timer (countdown)

 

Health, Lives & Scoring

Health & Lives

Health bar

Health packs - healing

Scoring - including highest score