Please update your browser
Your browser version is not supported by this site. CS First may not work properly.
In this add-on, you will code a friend on the profile page to respond to your favorite
In the starter project, there are four friends sprites in your program that you can select.
You want the friend to say something when the friend sprite is clicked.
Add a "when this sprite clicked" event from the events menu.
Then, add a "say" block from the looks menu.
You can type anything in this space.
This example uses "We should hang out this weekend!"
When you click on the sprite to test it, it says "we should hang out this weekend!"
To make the sprite respond to some of the variables on the profile page, drag out a
"join" block from the operators menu.
Then, add another "say" block to your block stack, and put the "join" block inside the
new "say" block.
A "join" block links the two values inside it and displays the result.
It has two empty spaces where you can add values, like words, numbers, or variables.
This example will use one of the variables to say "My favorite food is also…" whatever
you put as your food variable.
Type "my favorite food is also" in the first value in the "join" block.
Click on the data menu, and drag the "food" variable block inside the second value space.
Now test your code.
When the friend sprite is clicked, the sprite says "We should hang out this weekend!
My favorite food is also tacos!"
Now, it’s your turn.
Code the friend sprites to "ping" the user when clicked by adding a "when sprite clicked"
event, a "say" block, a "join" operator, and a "variable" block.
Add code for as many of the friend sprites as you would like!
Feel free to add other blocks from the looks and motion menu to your code.