Skip to content

Please update your browser

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

arrow_back Surprise Features

Transcript

In this add-on, you will program hidden features in your project.

To get started, choose a sprite and costume that you’d like to code.

This example will start with the animals sprite and code for the dog.

Click on the animals sprite, and if you click on the costumes tab, note that the puppy costume is the first costume.

This example will program the puppy to make a barking sound if it’s picked for the style board.

Click on the sounds tab, and click “choose new sound from library.”

Click the different sounds to try them out And when you find something you like, click OK.

Next, click back on the scripts tab, and drag out a “play sound until done” block from the sound menu.

Change the sound in the dropdown menu to the sound you chose.

This example chooses ‘dog1’.

The sound should play if this sprite is clicked.

Drag out an “if-then” block from the control menu, and place it around the “play sound until done” block.

Next, grab an “equals” operator from the operators menu, and place it inside the “if-then” block.

Add a “costume number” block from the looks menu inside the first value of the “equals” operator.

Great.

Recall that the puppy costume is the first costume in the list, so type the number 1 in the second value of the “equals” operator.

Now this block says “if the costume number is 1, then play sound ‘dog1’ until done.”

Place this conditional under the “when this sprite clicked” event to make the sound play when the puppy sprite is clicked.

Now, test it out!

Click the flag, and when the program gets to the animals category, find the puppy, and click it.

The puppy barks!

Excellent.

Play around with other costumes in the different categories and consider adding other looks, motion, or sound blocks.

In another example, for the miscellaneous category sprite, when you click on the image you like for your style board, it does a 360-degree turn using a “repeat 10” loop and a “turn 36 degrees” block.

This happens regardless of which costume you choose.

Now it’s your turn Code a hidden surprise in your project using blocks from the looks, motion and sound menus.

If the hidden surprise is for a particular costume, use the “if-then,” “equals” and “backdrop name” blocks to code for a specific costume.

Place your new blocks under the “when this sprite clicked” event so the surprise feature occurs when the sprite is clicked.

Choose an Add-On
Color Change
Program your style board to allow the user to change the color of each category item.
Suggest Button
Program a feature that auto-suggests a costume for your style board.
Descriptive Objects
Program your images on screen to give an overview or description when the mouse hovers over them.
Surprise Features
Code a unique and unexpected action
Last Minute Costume Change
Code your project to allow the user to make a last minute change to the style board
Sprite Shares
Program your style board to have a sprite appear on stage and talk about your program.
arrow_backward Back
Next arrow_forward
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!