Step 1: Creating a Loop For Shooting Lasers

Goal:


Let’s start by creating a loop for the shooting lasers.

A loop is something that repeats over and over again until a condition is met.

This loop should repeat until there are no more blaster shots left (while “Blaster Shots:” < 1)

Steps:

  1. Click on the “Laser” sprite
  2. In Events, place a When I receive “StartGame!” block
  3. In Control, place a repeat until block
  4. In Operators, place  < (less than) block inside the repeat until block
  5. Change the right side of the < (less than) block to 1
  6. In Variables, place a round “Blaster Shots:” block on the left side of the < (less than) block

Code:



Click to replay