Creating games can be a very challenging activity. It requires high order thinking and imagination. Good games enable players to make decisions, be rewarded, reach goals and so on. The game developer therefore has to think logically in order to deliver these outcomes. In a primary school context it can develop skills in areas such as story boarding, graphic illustration, and basic computer programming. The complexity of the programming task will sometimes reside in the choice of the software.
Scratch is a program which is a free download. It is a new programming language that lets users create their own interactive stories, animations, games, music, and art. The website has lot of resources for users. Upload of users projects such as games, animations etc is strongly encouraged. So far more than 2.8 million projects have been uploaded by users from around the world. Once you login, you can view how the uploaded games were created. Scratch Day is now an annual event. The following are some screen shots of the statistics from its website.
Of significance is the statistics on the age of the users.
Getting started with Scratch
The scratch website has a lot of resources that can be useful for beginner and advacned first time and ongoing users. This link is a good starting point. The Getting Started guide is a very useful resource. ScratchGettingStartedv14. Go through this first.
When Scratch is opened – the following window will appear. Each part of this interface has a specific purpose.
(Source – http://info.scratch.mit.edu/Support/Reference_Guide_1.4)
- Each Palette will bring up a different set of programming blocks
- Sprites do all the actions in a project. Each time you open the program – you will see a cat – this is the default sprite. You can change and add/delete sprites as follows:
- There are numerous other options that can be pursued from here. To get used to the software, we will a create a game. The objective of the game is to get a crab (sprite) to its destination through a maze. You will navigate the crab through the maze with your keyboard. Each time the crab comes in contact with the maze, a sound is generated and it goes back to the start position.
- Open the program – if it is not open already.
- Right click on the cat to delete it.
- Choose another sprite from the costumes folder.
- For this game, chose the crab sprite from the “Animals Folder”.
- You can shrink the sprite to make it smaller. Drag the SHRINK SPRITE (1) icon onto the sprite to shrink it. Hit enter (on the keyboard) or click your mouse button to shrink it to the desired size. You can also change the name of your sprite. Type in a name you prefer in the space at (2). Now copy the following code block in your game. The yellow code (3) (from the Control palette) is read as follows – Each time the “up arrow key” is pressed on the keyboard, the blue codes (4, 5) (from the motion palette) makes the crab move 10 steps up (“direction 0”). Press the “up arrow key” – to test the sprite.
- Now copy the other codes as shown below. Notice the the name of the sprite (crab) has been changed to Mazeman (1). Test the sprite.
- Now it is time to paint the maze. Click on (1). This opens the Paint Editor (2). A maze can be created in a number of different ways. In this case, the rectangle tool(3) was used to create a number of rectangular shapes.
- This is one way to finish the maze using the line, rectangle and eraser tools.
- Click OK. You will see both sprites on the Stage. Click the up, down, left and right keys on your keyboard to control the sprite. Can you get it from start to finish?
- The maze sprite has been renamed mazewall(1) . The mazewall can be edited by selecting the EDIT(2) icon.
- Now lets create a script so that each time the “mazeman” (crab) touches any part of the maze, a sound is generated. Click on the SOUNDS Tab(1) and choose IMPORT(2). Select the sound file. In this case the Suspense sound clip (3) has been chosen from the instruments folder.
- Click Ok. Now let’s put some more controls in the mazeman. Click on the mazeman sprite (1). Then click on the scripts icon (2). Drag in the “When flag clicked” and “forever” code blocks (3) from the Control box (yellow).
- Drag “if” (1) inside the “Forever” (2) code block.
- Drag the “touching Mazewall” (1) block from the Sensing box (blue) to the “if” block (2).
- Click on the Sound box (blue). Drag the “Play sound until done” (1) block inside the “if” code block (2).
- Click the green flag. Navigate the mazeman (crab) through the maze. What happens to the mazeman when it hits a wall?
- Add blocks 1 and 2 (from the blue box – Motion) . How does the game change with these additions? What is the significance of the “Go to x:” command?
- Thats it! Can you explain how the game works? Change at least one aspect of the code to make the game more interesting.