Scratch Platformer


Scratch is very much a beginners tool for developing games. It has a low frame rate, which can cause issues, and cannot create instances of sprites, only hide and show them. It's main advantage is coding is created by assemblying 'code blocks' visual representations of common code fragments.This makes it less intimidating for young students to assemble a game. I highly recommend refering to the two Scratch reference documents listed in RESOURCES, before starting the Platformer project.

The process of creating code for a game is still a very complex task. Rather than open exploration, I provide instruction on platformer basics, moving, jumping, gravity,landing on platforms, changing backgrounds, but students design and create their own levels and obstacles. These are not complete step by step instructions, but a general guide to the process.


A Three Level Run and Jump Game

    The Game Development Process

  1. Character Design:Photoshop graphic or pencil and paper sketch. (1/2 hr with experience from previous animation)
    • Outcome:Explore the process of creating characters with appeal
    • Outcome:Develop mechanical and digital drawing techniques
  2. Storyboard:Pencil and Paper plan for a 3 Level Game includes a Title Screen, 3 Levels, and Win Screen(1 hr)
    • Outcome:Explore the process of planning interfaces and levels with storyboards
    • Outcome:Develop mechanical and digital drawing techniques that clearly explain shots and the connection between shots
  3. Start Screen with Interface: Background, Title, Start Button and Instructions
    • Outcome:Create Backgrounds for each level
    • Outcome:Create Title. Start and Instructions buttons
    • Outcome:Create Programming to show instructions, to change background to first level and show and hide sprites
  4. Character Animation & Movement(2 hrs.)
    • Outcome:Create a 2D Game Character
    • Outcome:Create a control system for left and right movement
  5. Jumping, Platforms, and Background (2 hrs)
    • Outcome:Develop programming to create a jump movement, gravity and landing
    • Outcome:Create platform sprites and arrange challenges
  6. Goal Objects, Obstacles, Level Changes.(2 hrs)
    • Outcome:Create or add an existing sprite to act as goal for the first level
    • Outcome:Create obstacles or enemys, such as moving platforms, monsters.
    • Outcome:Create programming to move platforms or enemies, show and hide appropriate sprites, change background if goal is touched by player
  7. Sound:Selecting, importing and settings for sound.
    • Outcome:Maintain legal rights for sound artists
    • Outcome:Use correct methods of editing and importing sounds

These topics are outlined in more detail below. Click on the topic heading to expand or minimize the contents.

Character Design For Games [+]

There are lots of online examples of 2D characters for games. This game just requires a character to move left or right, so a side view works well.

Students should be encouraged to think about what the character would look like while walking. In Scratch games the frame rate is very low, so only two poses are required.


This artwork was done in Photoshop and then imported as a costume in Scratch. Character design can be done digitally or with pencil and paper.

Explain to students how EXAGERRATION of physical features, and emphasis on facial expression, creates APPEAL. PRINCIPLES OF ANIMATION

Game Storyboard [+]

Students should be encouraged to develop a unique setting for the game, ie "Jungle", "Monster Alley", "Sewer Crawl". This will help trigger ideas for obstacles and enemies.

Students should be encouraged to put detail into the storyboard, including deciding on the path the player needs to follow to beat the level. There is a link to a sample in the RESOURCES section

Explain to students how good STAGING of the game creates the sense of entering into the imaginary world, and ties in with ANIMATION AND CINEMATOGRAPHY.


Start Screen & Interface [+]

The Start Screen includes the title of the game, the author, a way to view instructions for the game, and a button to click on to start the game.

startscreenWhen using Scratch I find it very important that students create the start screen, and basic backgrounds for the other levels first, then work into creating the other levels. This is done on the Stage, by creating new backgrounds To start with just having a different color of stage Background is enough to distinguish between levels. The easiest way to set up level changes is with a variable "LEVEL" set up for all sprites. This allows the game to follow a logic that when the variable "LEVEL" = a certain number, specific things should happen, such as showing and hiding Sprites. I like to use level = 0 to set the Stage to the Start Screen.

With the structure of levels created, the LEVEL variable can be set to 0 when the game starts.

Character Animation & Movement [+]

As shown in the images under Character Design, animation can be kept to simply creating frames to indicate taking a step. More elaborate animations can certainly be incorporated into Scratch but for a first game, just a simple indication of movement is enough. This character was created by clicking on the Paint New Sprite button and then importing the art work for the two poses as separate "costumes"

The next step is to add scripting on to the sprite. This is done in the Scripts section of the main window. At the top of the Scripts section there is a button to restrict the sprite from rotating:

This will allow the character to flip without rotating when changing direction .

Scripting in added onto the sprite by dragging and dropping and assemblying code blocks into the sprites Scripts tab or section.

To apply movement onto the character, click the Control group of programming blocks. For movement a keyboard event "when key Pressed" is used, with the appropriate key selected from the drop down list.

The section of code shown above, sets up movement and costume changes, in the "when left arrow pressed" and "when right arrow pressed" blocks.

Jumping, Platforms and Backgrounds [+]

The section of code above also starts gravity for a player character when the game starts. Gravity is created by having the character always falling, (change y by -8), unless they are touching the color of their shoes to a specified color platform. Any sprite created with a strip of the designated color becomes a platform. It also illustrates the use of variables to control the Speed and JumpHeight for the character. These variables are given a value at the start of the game. They could be replace with integers if desired.

Goals, Obstacles and Level Changes [+]

This code sample shows code attached to a different sprite, acting as the goal for a level. When the player sprite touches it, it triggers a change to the variable "Level", this triggers code on the Stage to change the background and code on some sprites to show or hide.

Along the way the player character will have to jump around platforms and overcome challenges to complete the game. In these examples the Dinosaur has to collect the eggs. Touching the eggs triggers a level change. This is a great example of what a Grade Nine student can do, given some structure and a little bit of help with the code building.