Project 442: Infinite Flying Game

6. Clone your obstacle

Write a piece of code that clones your obstacle every few seconds - the amount of seconds between each clone should be random to keep things interesting.
Starting point file for this challenge

Your goal

Steps

1. Click on your obstacle sprite, and add a "when green flag" clicked

Double check that you're coding your obstacle sprite, and then add the yellow "when green flag" clicked block. 

2. Add a "hide" block

Sprites that are cloning other versions of itself usually work best if they stay hidden. That way, the only versions that will show will be the clones. This is a purple "looks" block. 

3. Add a "forever" loop block

Since we want the obstacles to create clones the whole game, we need a "forever" loop. This is found in the "control" section. Put it below the "hide" block. 

4. Add a "create clone of myself" block

This is found in the "control" section. Since we want this to be happening forever, where do you think the block needs to go? 

5. Add a "wait __ seconds" block

Without this block, your obstacle will be cloning itself way too fast. Tell the game to pause, or wait, between clones. 

6. Randomize the wait time

Using a green operators block, can you tell the code to pick a random amount of seconds between 0.1 and 2 seconds?