Professional Documents
Culture Documents
P6 - Birthday Card
P6 - Birthday Card
ART B I R T H D AY C A R D
HAPPY
This project uses the “glide”
block, which makes sprites
move smoothly around
the stage. You need to use
How it works Scratch’s coordinates system
to set the exact start and
When you run this project, a
finish point of each glide.
mysterious flashing green button If you can’t remember how
appears. Press the button and an coordinates work, see the
animated birthday card fills the Happy birthday Funny Faces project.
to you!
screen, complete with singing sharks.
The sharks take turns singing the
lines of the “Happy Birthday” song.
Birthday Card
by PartyPlanner120 (unshared)
△ Keeping time
Like Animal Race, this project
uses messages sent from one
sprite to another to control
the timing of scripts. The
singing sharks send messages
back and forth to time their
Click the button to open The sharks drop in from the top The cake slides into view lines of “Happy Birthday”.
the birthday card. and then sing “Happy Birthday”. from the edge of the stage.
1
Project 6
ART B I R T H D AY C A R D
Birthday button
Surprise!
4 Scratch’s paint editor will now open. Choose the text tool T and click
in the large white area, about a third of the way down. Type the words
To avoid spoiling the surprise of the card, all “PRESS ONLY ON YOUR BIRTHDAY!” If you want to re-type the message
that appears when the project is run is a message for any reason, use the select tool to draw a box around the text and
and a button for the birthday person to press. press delete on your keyboard before starting again.
New backdrop:
1 Start a new project. Remove the
cat sprite by right-clicking on it
backdrop1 Clear Add Import
3
in the sprites list and selecting To add the sign saying “PRESS ONLY
“delete”. Load the Button1 sprite ON YOUR BIRTHDAY!”, you need to edit
1
from the sprite library. the backdrop. First select the stage
by clicking the small white rectangle
Button1 to the left of the sprites list. Then
click the Backdrops tab above the
blocks palette.
PRESS ONLY ON YOUR BIRTHDAY!
2 Add these two scripts to Button1. The first one makes
the button appear in the centre of the stage and flash
backdrop1
480x360
2
Project 6
ART B I R T H D AY C A R D
8
Make sure you still have the stage This block shows the
selected in the lower left of the Scratch white backdrop.
when clicked
window and not one of the sprites.
Click on the Scripts tab above the
switch backdrop to backdrop1 ▾
blocks palette and add these scripts
for the stage. Now try running the The “party” backdrop The starting position of
project and see what happens with balloons appears the cake (–300, –100)
when you click the button. when I receive Go! ▾ when the button is pressed.
12
Once the button is pressed, the card opens. The Add these scripts to the cake to hide it when
button’s script broadcasts the “Go!” message to the project runs, and then make it glide in
This is the cake’s starting
all the sprites to trigger the animations and music. from the left when the green button is pressed.
position off the left
Note that the cake broadcasts a new message, of the stage.
called “Line1”. Later you’ll use this to make
one of the sharks sing the first line of
“Happy Birthday”.
3
Project 6
ART B I R T H D AY C A R D
Birthday banner 15 Click the centre tool in the top right of the paint
editor and then click in the very centre of your
The next thing needed for a party HAPPY BIRTHDAY banner. This is important as the banner’s script
atmosphere is an animated birthday will make it rotate around this point.
banner that rocks back and forth.
HA
HAPPY BIRTHDAY!
go to x: 0 y: 120
–90° moves a
sprite straight 0°
to the left.
Rectangle
tool
when I receive Go! ▾ –90° 90°
Text tool HAPPY BIRTHDAY!
point in direction 80 ▾
180° moves a
show The banner starts sprite straight
down.
off tipped a little
anticlockwise.
180°
Choose forever
Selected colour colours here.
turn 20 degrees
It turns Use the blue “turn”
wait 1 secs clockwise. blocks to make the
Outline 100%
turn 20 degrees banner turn.
4
Project 6
ART B I R T H D AY C A R D
Singing sharks 21 Time to get the sharks singing. Remember the loop belonging to the cake sprite
that plays Happy Birthday? It sends the message “Line1” every time the song
What’s the perfect finishing touch to a birthday surprise? starts. Add the scripts shown on the left to Shark1 and the scripts on the right
Yes, of course... singing sharks! The two sharks will take to Shark2 to make them react to the message. More messages make them take
turns singing by sending messages to each other after turns to sing each line. You’ll need to create new messages for each line of the
song. Name them by using the drop-down menu in the “broadcast” blocks.
each line of the song.
The shark
starts out with
when I receive Go! ▾ a costume
that has its
when I receive Go! ▾
22 The birthday card is now complete.
Click on the full-screen symbol
show mouth closed. show above the stage and run the project
for the birthday boy or girl!
glide 2 secs to x: –165 y: –70 glide 2 secs to x: 165 y: –70
5
Project 6
ART B I R T H D AY C A R D
△ Adding photos
▽ Fading in ▽ Supersize your sprite Why not try importing a photo of the birthday boy
The sharks drop from the top when they appear, Another way to make a dramatic entrance is to or girl into the project? You can upload any picture
but you can use Scratch’s special effects to create start tiny and grow into a giant. Put a “change size you like to make a new sprite by clicking the upload
a more dramatic entrance. To make an invisible by” block in a “repeat” loop to create this effect. You symbol in the sprites list. But don’t share projects
sprite fade in slowly, for instance, use the “set could also try making your sprite spin as it grows, containing people’s photos without their permission.
ghost effect” block in the script shown here. or add a “change whirl effect” block to turn it into
a crazy whirlpool.
change size by 5
when I receive Go! ▾