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.
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
Move Your Hero
Make your hero move up and down when arrow keys are pressed.