AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Debug and build games

Week 25 · Unit 10: Be a game developer · 3 lessons
3

Stamps, pens and play time

Computing 4: Unit 10, pp. 138–151
GoalUse the pen blocks to draw and stamp, trace a pen script, and describe how to keep game playing healthy.
New words
pen down · a block that makes a sprite draw a line when it movesstamp · a block that leaves a copy of the sprite’s picture on the stageerase all · a block that clears every pen line and stamp from the stage
Explanation

Scratch has pen blocks that you add as an extension. With pen down, the sprite draws a line wherever it moves. Pen up stops the line. The stamp block leaves a copy of the sprite’s picture where it is, and the sprite can then move on and stamp again. Erase all clears the stage. A repeat loop with a stamp and a move makes a row of pictures. A sub-routine can draw a shape that several scripts use. Games are good for quick reactions and planning, but too much play tires our eyes, steals sleep and keeps us from playing outside. Take breaks.

pen downpen upstamperase allset pencolorto50
Worked examples
x 240−240y 180−180sprite
A flower garden. Script: go to x: −150, y: 0, then repeat 6 times: stamp, change x by 50. The sprite stamps a flower, steps 50 to the right and stamps again. Stamps are at −150, −100, −50, 0, 50 and 100. The sprite itself ends at −150 + 6 × 50 = 150.
x 240−240y 180−1801234
Stamps in a square. The sprite starts at x: 0, y: 0 facing 90. In each round it turns ↻ 90, moves 60 and stamps. Round 1 faces 180 (down) and stamps at (0, −60). Round 2 faces 270 and stamps at (−60, −60). Round 3 faces 0 (up) and stamps at (−60, 0). Round 4 faces 90 and stamps at (0, 0), where it began.
when this sprite clickedturn ↻90degreesmove60stepsstamprepeat4
This is the script for the square of stamps. When you make or play games, plan the time as well: a break every 30 minutes, time outside, and stopping in time to sleep.
Class activity

Card stamps (with a friend): cut a small star or leaf from card. This is your stamp. Put it on a big sheet of paper and trace around it with a pencil each time you “stamp”. Follow this script with a ruler and a card: turn right 90 degrees, move 6 cm, stamp. Do this 4 times in all. Do you get a square of stamps? Then write a script that makes a row of 5 stamps and try that. Last, make a play-time plan for your week together.

Practice
1
A sprite starts at x: −100, y: 0 facing 90. It follows this script. Describe the line it draws and say where it ends and which way it faces.
whenclickedgo to x:-100y:0pen downmove50stepsturn ↻90degreesrepeat3
2
Write a script that stamps 5 stars in a row, 40 steps apart, starting at x: −80. Where does the sprite end?
3
The programmer wanted 4 stamps in a row, but the stage shows only the sprite. Find the missing block.
whenclickederase allgo to x:0y:0change x by30repeat4
4
Give two things you can do to play games in a healthy way.