Games Elements
BOOK 2 Quick Reference pages (1 – 20) introduces PART 1: called Game Elements. These are centred on short snippets of code that add excitement and realism to online games. They comprise much of the content of the section and there are some exciting games also. Code club mentors will find the FlipBook plus lesson worksheets especially helpful. Game Elements include; coding games that can be played on either Keyboards or Touchscreens, coding a Start Button, an Instruction Screen, 3D Effect, Scrolling Backdrops, Invisibility, Sprites made from Backdrops etc. The real fun at this stage is learning how to use the few Computational Thinking (CT) skills that are fundamental to SCRATCH game development. Adult Scratchers will certainly enjoy CT with SCRATCH and the kids need CT more than ever to enjoy coding technology.
1. Fruit Shower for Keyboards & Touchscreens
Fruit Shower: It’s raining fruit from the sky. To collect as much fruit as possible in 1 minute you must move the fruit bowl left and right using swift movements. Strawberries are worth the 50 points but are difficult to collect. Apples are worth only 5 points and are easiest to collect. When fruit hits the red area 5 points are deducted. This is a game with elements of both skill and chance. Nimble fingers and a quick reflex play a big part in this game. Try Computational Thinking [p.104] to come up with the best approach to moving the bowl. Fruit Shower for Touchscreens is probably best for all devices. Try both versions and judge for yourself. [Book p. 102 – 106]
2. Jump Jockey and Scrolling Backdrop
Jump Jockey: The hedge jump and the backdrop move continuously from right to left while the horse appears to be galloping. Depending the device type, the player presses the spacebar (or clicks the horse) to make it jump the fence to score a point. The game is less effective if the horse’s nose or front hoof are programmed to ‘touch’ the fence. It is the jockey touching the jump that loses a score, not the horse. The code on the jockey positions the jockey back where the saddle is. If the jockey’s leg touches the fence the game is over. Click See inside to see how the scrolling backdrop is coded and how the jockey is attached to the horse. Think of ways you can improve the game. [Book p.107]
3. Gravity, 3D Effect & Double Click
Deep Sea Diver: The diver sinks to the bottom because of Gravity. Raise him with the Up arrow and move him left or right with the arrow keys. Moving him keeps him from sinking because of the counter gravity code in the script. 3D effect: The backdrop is vector, so you can bring the rocks and seaweed to the front as a sprite. With layer code you can move the diver behind the rocks and seaweed. 3D-Effect is also illustrated in the Bedroom Clutter project, with objects hidden under a cut-out bed sprite. The original bedroom backdrop is a bitmap but you have the bitmap eraser to make a sprite out of the bed. Clicking: Bedroom Clutter also demonstrates game elements, a single-click and a double-click. Single shows (unhides) a musical instrument and double makes it play music. See inside the projects to investigate the game elements. [Book p. 109]
4. Make Sprites from Backdrops
Desert Life and Bear in the Wood
(Click ‘See inside’.) These two short project illustrate a number of Game Elements:
A. 3D Effect with Cactus sprites cut from a bitmap backdrop
B. the snake’s costume 2 is altered from the original library sprite (its head is turned)
C. Invisible marker sprites to make it easy to code the desert bug to jump from one location to another.
D. Bug has a 2 costumes (the original sprite in the library has only one costume).
[Book p. 110]
5. The Submarine and Helicopter
Invisible Submarine: You control the submarine with the UP, LEFT or RIGHT keys to move it to collect starfish points. When you stop moving the sub, it descends to safe water at the bottom and disappears, but you can see its bubbles! You have 3 minutes to score 2000 points to win. Collect points in multiples of 20 while you are touching the yellow starfish but, all the while you are bombarded from the helicopter. The red starfish lower down is worth far fewer points. Each time you are hit you lose one of your 20 lives. You can get all your lost lives back by diving to the seabed. Then you are automatically returned to the danger zone and the game continues! The game is over if you lose all your lives [Book p. 111 – 116]
6. The Scroll-down Car Maze
The Player pulls the car along by the mouse pointer which is set to the rotation point at the front of the sprite. The game backdrop scrolls vertically (from top down). The obstacle walls and openings gradually appear for the player to guide the car to the finish line. A feature of this maze, is the player having wait for a gap to open in the blue ball to take the car through. This is an unusual variation of the typical Scratch maze game. Open the project and click See inside. Alternate project: Bear in the Wood
7. Amazing Mazes
When you draw a maze with the sprite’s pen the drawing is lost when you close the project. One way to save your maze is to programme the algorithm to redraw it each time the project is opened. A better way is to draw the maze and export it as a sprite. This can be easily done with the 20px and 30px fine-line vector grids by name (Xy-grid-20px and Xy-grid-30px) that are now a part of the Backdrop library. The mazes in this project were drawn and saved as a sprite uisng the grids as guides. They also ensure coding accuracy.
9. Hop Rabbit Hop!
The rabbit has to cross a busy motorway to collect carrots in the field opposite. There are cars coming from both directions as you navigate the rabbit across the eight lanes to pick up one carrot at a time and bring it back to this side. Use the arrow keys to cross the motorway, dodge the traffic, collect carrots and survive to win.
10. The Six-Horse Race Dice Game
This is a race game with 6 horses on a six-lane track of 12 squares; ten race squares, plus start and finish squares. Each horse is identified by a number and colour that correspond to the six sides of a dice. Two similar dice are used. When a horse’s number is ‘rolled’ the horse of that colour moves one square. If both dice roll the same number, the horse moves two squares.
A 3-page PDF of 6-Horse Race is uploaded here. Click PDF Worksheet.
11. Breakout Game
Breakout was a popular arcade game developed by Atari in the 1970s. Layers of bricks line the top third of the screen. A ball travels across the screen, bouncing off the top and side walls. When a brick is hit, the ball bounces away and the brick is destroyed. The player loses a turn when the ball touches the bottom of the screen. To prevent this from happening, the player has a movable paddle to bounce the ball upward, keeping it in play. Note: There is a pattern of repetition in the code that will make it easy to create the missing scripts.
12. Scenes in the Jungle
Click the green flag and watch the squawking Toucan, frightened Hedgehog, scared Snake, prowling Lions and mischievous Monkey all make their brief appearance on this Jungle stage. If you are inquisitive as to how it’s programmed, you can get PDFs in the Files section of the Teaching with Scratch FB group. Click See inside.
A 3-page PDF of Jungle Scene3 is uploaded here. Click PDF Worksheet.
14. Monkey Pop-Up
This is like the popular Whack-a-Mole game, except it’s whack-a-Monkey. The player whacks a monkey with the drumstick when he pops his head up out of the hole. In this game, you click the drumstick to score a point. You have 30 seconds to score as high as you can. The Monkey pop-up action is brought about by a ‘next costume’ sequence of its ten costumes. Export the pop-up monkey and drumstick or enjoy drawing your own. Strike Action: This is a game element, that could be used with a magic wand in a fairy story or game.
15. Birthday Cake Candles
To start, input the Birthday kid’s age. That’s the exact number of candles that go on the cake one-by-one. Each candle bursts into light and a fanfare of balloons fills the scene to the ‘Happy Birthday tune. For an extra treat, the elephant thinks the message aloud, ‘click me’ and waits to be clicked. He’s quite good on the trumpet and he even composes his own music. Study the purpose of the invisible cat who disappears immediately at the start!
16. Jungle Platform Game
Click the green flag for instructions. The Monkey must collect bananas from the tree opposite his starting position. The bananas one-by-one grow at each level into a bunch of 5. Your mission as player, is to collect a bunch of 5 bananas and win the game. You have 3 lives. You lose one life each time you fall into the mud or hit the bottom. If you lose your 3 lives you lose the game.
17. Animal Picture Quiz from a List
Picture Quiz: This is a simple quiz consisting of 20 picture questions. The quizmaster Cat asks the names of animals from picture prompts. The player’s answer must have correct spelling.
Word Quiz: This Quiz has two lists; 40 Questions and 40 Answers. Each time you run the Quiz, 20 questions are selected randomly from the 40. You can easily change the questions and answers of a Scratch quiz by typing new Q&As as text files. See https://scratch.mit.edu/projects/301861199 This Quiz generator creates text (txt) files to import into Scratch Q & A lists. No need to change the code.
18. Save the Snowman: Word Game
This is a self-challenge Guess-a-Word game. The player can choose the length of the word from 3 to 8 letters. Scratch selects a word from a data-base and you don’t know it until you guess it or fail. There is a second version of the game, where one person inputs a word for a friend to guess. It’s called Challenge-a-friend and you can find a link to it in the instructions.
Creating the Snowman project is explained in detail in the final pages of flipBook 4, Design Art.
A PDF of Alphabetical Order is uploaded here. Click PDF Worksheet.