Skip to content

Please update your browser

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

  • Hour of Code logo icon
  • Celebrate CS Education Week

  • Teachers! Planning an Hour of Code™? Start here.

https://storage.googleapis.com/files.cs-first.com/Code%20Your%20Hero/HOC_Code%20Your%20Hero%20-%20activity%20icon.png

1. Introduction: From Hero to Superhero

Transcript

Welcome. I’m KaMar, a computer scientist and program manager at Google.

I’m originally from the Virgin Islands and now I teach students all around the world how to program.

I’m excited to share this activity about coding a hero story or game!

By coding everyday heroes that make a difference in your world, you can turn them into superheroes!

First, here’s a quick introduction to learning computer science through CS First.

With computer science, you can create anything you can imagine, like: stories, art, animation, music, websites and more!

Computer science uses code to make projects called programs.

Code is another way of saying "instructions for the computer."

There are a lot of ways to write code, but today, you’ll use a programming language called Scratch.

In this activity, you will choose an everyday hero from your own life.

Then you’ll build a project using code that shows your hero as a superhero!

Everyday heroes can be patient and kind, like a teacher who explains things to you in a supportive way until you understand it, or caring, like a grandparent that watches over you when you are sick, or supportive, like a seeing eye dog that helps a blind person cross the street, or encouraging, like a coach that believes you can do anything if you work hard.

To get started, open the starter project in a new tab.

You can pause the video to add to your project, or you can watch the entire video, then complete the steps.

Scratch includes costumes that change a character’s, or sprite’s, appearance.

In this project, the costumes are different sprites you can choose.

Select the costumes tab, and pick one to represent your hero.

Next, make your sprite say something about what kind of hero they are.

'From the looks menu, drag out two “say for 2 seconds” blocks, and connect them.

Click the block stack to see what happens.

Change the text in the blocks to show your hero’s personality and powers.

Tinker with the values in the seconds, then click the block stack to test.

These blocks run in order. This is called "sequencing code."

Add as many “say” blocks as you’d like, and type in text to make your sprite say more about their powers.

To start your program when the flag is clicked, add a “when flag clicked” event from the Events menu to the top of the block stack.

Click the green flag.

Great.

Once you’ve programmed your hero to talk about their powers, try “Move Your Hero” to start adding to your project.

Then, come back to this page to check out more videos!

You can try any video you like.

Choose an Add-On

Start here
Move Your Hero

Make your hero move up and down when arrow keys are pressed.

Fly Over Buildings

Program buildings to move across the screen, so your hero appears to fly.

Add Background Music

Set the scene for your hero by adding sound to your project.

Show Off with a Super Spin

Help your hero do great things with this spinning move.

Keep Score

Create a game by programming your hero to collect objects.

Support Your Hero

Add another character to help your hero.

Draw Your Own Hero

Use the Paint Editor in Scratch to draw your own hero.

Instructions

Para hacer esta actividad en español, haz clic aquí.

 Students

  1. Watch the introduction video.
  2. Open the starter project link and choose a sprite for your hero.
  3. Return to this page and watch more videos below.

Teachers

  1. Visit the Hour of Code teacher resource page for instructions.