Skip to content

Please update your browser

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

Transcript

In this add-on, you'll program the characters in your story to react when the lightning strikes.

First, click on the stage.

When the lightning strikes, you'll need to broadcast a message to the other sprites that it's time to react.

To do this, select the Events menu and add a broadcast block after the wait block.

Change the name of the message to something like, Lightning.

Now, when the lightning strikes, the lightning message will be broadcast to the rest of the program.

Next, program the sprites to respond to that lightning strike message.

Click the character that you wan to respond.

Then drag out a when I receive lightning block.

Any code you add to this event will only run when the lightning message is broadcast.

To test this, add a say for two seconds block to the code and run it.

Great.

Now when the lightning strikes, the sprite says, ahh!

The broadcast lightning block triggers the code under the when I receive block.

Now it's up to you to create other ways for your sprite to react to lightning strikes.

The reaction should go with your character's personality.

Is it scared, evil, brave, silly?

Think about the character in your story and how they would react when lightning strikes.

Now it's your turn.

Select the stage and add a broadcast block after the wait block.

Second, rename the message and call it Lightning.

Third, use a when I receive lightning event to start your character's reaction.

Fourth, program the character's reaction.

Choose an Add-On

Lightning Reaction

In this add-on, you’ll program the characters in your story to react when the lightning strikes.

Drawing and Animating a Lightning Bolt

In this add-on, you’ll draw and program a user-controlled lightning bolt that moves from the sky to the ground.

Sun Comes Out

In this add-on, you’ll program a second scene for your rainy day story.

Playing Thunder

In this add-on, you’ll play thunder and rain sounds in your story.

Earthquake

In this add-on, you’ll broadcast an earthquake to really shake up your story.

Code a Rainbow

Draw and program a rainbow to appear in your rainy day story!

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!