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 Color Change

Transcript

In this add-on, you will your sprite's color for your music video.

First, choose a sprite that you want to use.

You can either can a new sprite, or just click on the one that is already in your project.

This example uses the star.

With the sprite selected, go to the My Blocks menu, and click make a block.

Name the block change color, because when this new block is clicked, the sprite will change colors constantly.

Naming the block change color won't make it do anything, though.

You still need to instruct the block how to change colors by adding code to the define change color block.

Go to the looks menu, drag out the color change effect by 25 block, and attach it to the define change color block.

Click on the stack, and the sprite will change colors slightly.

But you want the sprite to change colors over and over again, so add a repeat block to this stack.

Remember to tinker with the values in the white boxes until you get an effect that you like for your project.

Changing the value in the repeat loop will make your sprite change color longer, and changing the value in the change color block will change how different one colors is from another.

Play around with the values to see what happens if you make that number much smaller or much larger.

The best way to discover what something does in computer science, is just to try it.

The change color block is now defined, and changes the color of the sprite.

But don't forget to actually use it in your project, and tell the computer when to run it.

Use the when flagged click block, with the forever loop to make the sprite change color over and over again.

Now it's your turn.

Use make a block to create the change color block, use some blocks like you see here to define change color and make your sprite change colors over and over again, place your newly created block into the when flagged click block, and a forever loop.

Add some wait blocks to make it happen many times while your music plays.

Choose an Add-On
Dizzy Sprite
In this add-on, you will make a spinning sprite.
Color Change
In this add-on, you create cool color change effects.
Bounce Around
In this add-on, you will create a block that programs your sprite to bounce around the stage.
Dance Fever
In this add-on, you will give your sprite some dance moves.
Make Some Magic
In this add-on, you will create some sprite magic.
Squeak
In this add-on, you will add a sprite with cool movement effects to appear and hide on the stage.
Background Change
In this add-on, you will switch up the background.
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!