Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more

Choose an Add-On
play_circle_filled
+1 Button
Program a "plus 1" button so users can express that they liked your page.
arrow_forward
play_circle_filled
Post a Shoutout
Code your program so that users can give a shoutout or share a post.
arrow_forward
play_circle_filled
Pump the Jams
Add music to your profile page.
arrow_forward
play_circle_filled
Change Profile Picture
Code your profile android to change its look
arrow_forward
play_circle_filled
Ping
Program your friend's sprites to respond to your favorite stuff!
arrow_forward
play_circle_filled
Hidden Feature
Code a surprising action on your profile page!
arrow_forward
  • 1. Profile Page Introduction
  • 2. Code a Question
  • 3. Store Variables
  • 4. Ask Questions
  • 5. Add-Ons
  • 6. Reflection
  • 7. Wrap-up: Profile Page
  • 8. Wrap-up: Share Your Project
  • 9. Wrap-up: Show Your Project
arrow_backward Back Next arrow_forward
Transcript

In this add-on, you will code a friend on the profile page to respond to your favorite stuff!

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!"

Awesome.

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!"

Yes!

It works!

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.

Instructions
  1. Choose an Add-On, and click "watch" to learn how to build it.
  2. Once you finish one Add-On, try another one below the video!