Project 544: Infinite Runner

5. Design and clone obstacles

You'll need a new sprite to be an obstacle sprite. That obstacle should clone itself forever, but how often a new clone pops out should be random.
Starting point file for this challenge

Your goal

Steps

1. Pick a new sprite

Click on the blue cat face in the bottom right corner of Scratch to open up the Sprite library. 

2. Set the obstacle's starting point

Click and drag to place the obstacle near the ground, on the right side of the screen.

3. Hide the parent

Put a new "when green flag clicked" to the obstacle sprite. Then, give it a purple "looks" block called "hide."

4. Code the obstacle's starting point

Add a "go to x: __ y: __" dark blue "motion" block and place it underneath. Your numbers will probably be different than the example! You'll want to make sure they match the same coordinates in the sprite properties. 

5. Add a "create clone of myself" block

This is a "control" block. Put it beneath the "hide" block. 

6. Repeat the clone block forever

Put a forever loop from the "control" section around the cloning block.

7. Add a delay between clones

Add a "wait __ seconds" from the "control" section inside of the forever loop. Without this block, your obstacle would be creating hundreds of clones all at once!

8. Randomize the delay

Find a green "operators" block called "pick random __ to __" and drop it inside the wait block. Experiment with different ranges of numbers. The example would wait anywhere between 1 - 4 seconds before making another clone.