Activity Cards - English
Activity Cards - English
Valuable Information
The Scratch Interface is divided to three:
1. Stage
2. Sprite/background properties
3. Scratch Action Blocks
Building the game by designing the sprites and the background.
Adding scripts to the sprites and positioning the sprites on stage
Your Task...
1. Use the buttons under the stage to add a" sprite from file", or
"surprise sprite"
2. Give a meaningful name to your sprite in sprite properties (like
Ghost or Orange Cat)
3. Repeat the action with your other sprites
Valuable Information
The main tools in the Paint Editors are:
1. Rotate, flip and size tools
2. Sprite editing tools(paintbrush, select, eraser, stamp)
3. Color Palette
Drawing Area
1 2
Valuable Information
The background is used to design various levels/rooms of a game.
To add/change background, press the background button at the bottom of the stage.
At the properties area choose background tab
You have three options to add a background:
1. Paint- in scratch paint editor (card 1.1)
2. Import- Import an external image from Scratch's library or your own
3. Camera- use a web cam to capture an image
2
1
Valuable Information
What are Scratch Action Blocks?
An Action Block is a graphic block that contains an instruction.
Scratch Action Blocks are divided to groups, that are marked with different colors.
You can add Scratch Action Blocks to any sprite or background.
When you put together various Action Blocks, you create a Script.
Scripts are actually programming of the sprites.
Blocks In a Script
-90 90
180
Valuable Information
Sprites in Scratch can rotate in three possible ways:
1. Vertically-(up and down) this is the default setting
2. Horizontally-(Left and write)
3. Fixed – the sprite doesn’t change direction
Valuable Information
A loop is an action that repeats itself numerous times instead of repeating
Code writing manually. In Scratch, we have four types of Motion Animation:
1. Forever-the script runs as long as the game runs- for example: sprite animation
2. Repeat..-the script repeat itself up to the number in the loop-for example- timer
3. Forever if... the script runs only when the condition is fulfilled (see card 2.7)
4. Repeat Until -The script stops when condition fulfilled- for example :
Number of apples
Common Motion
Animation Patterns
1 2
3 4
Valuable Information
Following a sprite gives the programmer the ability to create sprites
that automatically follows another sprite.
Chasers, bullets and ball games are some of the options.
1 2
3
1
2
Valuable Information
So far you've learnt to:
1. Add sprites and backgrounds and edit them graphically
2. The ways to move your sprite and three rotation styles
In this card you will practice all these topics combined.
2.3 2.4-Motion Path 2.5
4
1
2
Valuable Information
With Scratch coordinate system, there’s accurate control of sprites’ motion.
1. The Stage is divided by two hidden lines (axis)
2. A horizontal line (named X), a Vertical line (named Y)
3. Each point on the axis has a value
4. At the center of the screen X=0 Y=0
5. When a sprite moves, it's X & Y values changes according to movement
6. The sprite's X & Y values can be found in the sprite properties
Y =Positive
Y =Positive
Y =Positive X =Positive
X =Negative
X =Negative X =Positive
Y =Negative
Y =Negative
X =Negative
X =Positive
Y =Negative
Valuable Information
Sensors are action blocks that checks on various conditions and data.
A sensor block is not a standalone block. It is inserted into other blocks.
There are two types of sensor blocks:
1. Value sensor- these blocks test a numerical value- X&Y value of a sprite,
distances, volume level etc.
2. Test sensor- These blocks test if various conditions happen- mouse button
pressed, color touches another color, sprite touches another sprite etc.
1 2
1 2
3
Valuable Information
Collisions are contact between sprites or between a sprite and certain color
You check collisions with conditional sentences (If Car touch Tank...)
Conditional sentences (also known as IF sentences) are under control tab.
Collision are used for:
1. Points
2. Collecting and hiding objects
3. Changing levels and setting location of sprites
Your Task…Refill
1. Add two sprites- one of a car and one of a fuel tank (a royalty free site
for costumes (www.clker.com)
2. Program the car to follow the mouse pointer or to move with keys
3. Add the script under the title "fuel tank" to the appropriate sprite
4. Add the script under the title "car" to the appropriate sprite
Valuable Information
Broadcast is an order that is sent from one sprite to another (others) sprite.
Using broadcast controls many events at one time – repositioning sprites,
hide/show sprites etc.
The programmer names the broadcast. There is no limit to the number of broadcasts.
The block broadcast is part of a script.
The block when I receive… is an starting block.
Valuable Information
A lot of sprites change form and location during the course of a game.
Reset Scripts are used to reset the sprites to their initial status.
Reset scripts set the hide/show status, point direction, X & Y location and setting
points and lives to initial values.
During a game, the location of a sprite is usually set in a collision script with another
sprite or the edge.
New Level
Position and show reset scripts
Valuable Information
A variable is like a container whose content constantly change.
The variable is given a name by the programmer when created.
Variables are used for counting points, or lives of a player, or to remember
an action (Counter Variable). There are two types of variables:
1. Global Variable- a variable that all sprites can affect
2. Local Variable- a variable that is affected only by sprite it was created in
1
2
Valuable information
Counters are variables that are used for events such as-
points change, shooting and timer. There are two types of counters:
1. Automatic Counter -this counter value change in a loop
(like the variable time that counts seconds)
2. Event Counter-the loop of this counter is triggered after a collision
or a keyboard / mouse input
In counter scripts before the loop insert Set… to… block to reset the variable.
In event counter script use wait until block to repeat the loop one at a time.
Valuable information
Math operators are used for various calculations.
There are five types of operators:
1. Basic Calculations-round block- multiply, division, add, subtract
2. Comparisons- bigger then, smaller then, equal
3. Advanced calculations
4. Additional condition blocks
5. Random numbers (one block- range of random numbers like the lottery)
Comparison script
A Negative condition
block Script
1 2 3
4 5
Valuable information
Scrolling is a method to create a genre of games known as platform games
such as Mario bro.
In these games the background is constantly changing and creates
an illusion of movement. Unlike other games, in this game,
the background is actually a series of sprites and most of the work is in designing
them to look like continuous background. For our purposes, we use the file called
scrollDemo in the Games folder in Scratch.
The New Sprite File > Open > Examples > Games
Valuable information
An array is a variable that stores a large number of values
The values in an array are called items. An Array can hold numerical or textual items.
During a game more items can be added to an array and used later.
. In scratch Arrays are called lists. To add a list:
1. In the Variables tab choose Make a list
2. Add the items to the new list
3. Use the items in various scripts
Add Crystal Ball and Fairy Sprites Add Costumes and Scripts
To the Crystal Ball Sprite
Duplicate to create
A “conversation”