Project 442: Infinite Flying Game

7. Make your clones move

Your clones should start on the side of the screen opposite your hero, and slowly fly towards it. When they hit the other side of the screen, the clones should delete themselves.
Starting point file for this challenge

Your goal

Steps

1. Grab a "when I start as a clone" event block

This is how we give instructions to the clones instead of the normal sprite. Even though it looks like an "events" block, this is actually a "control" block. 

2. Show the clone

First thing we should do is show the clone, because it's still hiding. Put the purple "looks" block "show" at the top of your code. 

3. Make the clones start at a random height on the right side of the screen

The clones are spawning all in the same place, which would make the game very predictable! Let's randomize where the clones pop up, but also make sure the clones always start on the right side of the screen so they don't show up too close to your hero. 

You'll need a "go to x: __ and y: __" block for this.

Scratch's screen width goes from -240 to 240. Knowing this, how do we make the clone go to the right side of the screen?

To make a random height, you'll need a green "operators" block, "pick random from __ to __." Scratch's screen height goes from -180 to 180. Knowing this, what range should go in your green operators block? 

4. Grab a "change x by __" block

This is a dark blue motion block. To move left, do we want a positive or negative number? 

5. Repeat moving left until it hits the left side of the screen

Grab a "repeat until ___" block and put it around the movement block. 

Grab a green "operators" block that looks like "__ < __." In the first blank, plug in a dark blue "x position" block. In the second, use -230, because that's the left side of the screen. 

6. Delete the clone after its done moving

Grab a "delete this clone" block and put it after the repeat loop.