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 make the hero shoot a laser to zap the bugs!

First, click paint new sprite, and draw a laser for your game.

This example draws a small, filled-in, red rectangle.

Program the laser’s motion.

It should start at the hero, then shoot forward.

So, the first block is the second “go to” block, the one with the dropdown.

Drag it out, then select “Hero” from the dropdown.

Make the laser shoot out once it’s at the hero.

Snap a “repeat until” loop from the “control” below the “go to” block.

The laser will repeat moving forward until it touches the edge.

From “sensing,” drag a “touching” block into the loop’s condition space, and select “edge.”

Then, from “motion,” place a “change x” block inside the loop.

Click to test!

The laser shoots across the stage!

But, it gets stuck once it gets to the edge.

To make it disappear, add a “hide” block.

That means you need a “show” block at the beginning to make it show again!

Test again!

That looks more like a laser.

Finally, make your laser look even fancier.

From the “pen” menu, drag a “stamp” block into the “repeat until” loop.

Click and see what happens.

That’s pretty cool.

Now, get rid of all these stamps when you hide the laser.

Drag a “clear” block below the loop.

Add an event to the top!

The “when space key pressed” event works nicely.

Great job.

Now, it’s your turn.

Paint a laser sprite.

Make it go to the hero.

Shoot it with a repeat until loop.

Show, hide, stamp, and clear to get all the visuals right.

Choose an Add-On
Game Over
Give your hero a set number of lives.
Laser
Program your hero to shoot lasers to vanquish the evil bugs.
Power-up
Add a power pellet to make the hero jump higher.
Falling Rocks
Add a falling obstacle to your game.
Platforms
The terrain of your game will change to move up and down.
Follower Friend
Add a cute buddy who follows your hero around.
arrow_backward Back
Next arrow_forward
Instructions
  1. Choose an add-on, and click "watch" to learn how to customize your project.
  2. When you finish, come back to the add-ons screen and try another add-on!