Step 2 of 8
25%
Set the stage
Open the Drum star starter project. Scratch will open in another browser tab.
The drummer starts in a bedroom like a beginner!
Click Choose a Backdrop and search for bedroom.
Select a bedroom and add it to your project. We chose Bedroom 3.

In Scratch, you can add code to the Stage.
Click on your bedroom backdrop from the Stage pane and add this code:
![]()
when flag clicked
switch backdrop to (Bedroom 3 v) //your backdrop name
Every musician needs to choose a rock star name.
A variable is a way of storing numbers and/or text. Your rockstar name will be stored in a variable so it can be used at any time.
From the Variables blocks menu, click the Make a Variable button.
Call your new variable name:

Notice: The new name variable appears on the Stage and can now be used in the Variable blocks.
At the start of the project, your rockstar name is unknown.
Add a block to set name to ???:
![]()
when flag clicked
switch backdrop to (Bedroom 3 v) //your backdrop name
+ set [name v] to [???] //your variable
You can ask a question in Scratch, then use a variable to store the answer.
Click on the Sensing blocks menu and add an ask block to your code:
when flag clicked
switch backdrop to (Bedroom 3 v) //your backdrop name
set [name v] to [???] //your variable
+ ask [What's your rock star name?] and wait //your question
Set the name variable to the answer:
when flag clicked
switch backdrop to (Bedroom 3 v) //your backdrop name
set [name v] to [???] //your variable
ask [What's your rock star name?] and wait //your question
+ set [name v] to (answer)
Right-click on the variable on the Stage and choose large readout:

Drag your variable to position it top-right of the Stage:

Test: Run your project to make sure the variable starts as ??? then updates to your answer.
You don't want to type an answer every time you test your project.
Drag the last two blocks of code away from the rest of the script.
when flag clicked
switch backdrop to (Bedroom 3 v) //your backdrop name
set [name v] to [???] //your variable
ask [What's your rock star name?] and wait //your question
set [name v] to (answer)
JuaraKu