Project 544: Infinite Runner

6. Program scrolling obstacles

The obstacle clones should start on one side of the screen, then slowly move towards your player. After they hit the other end of the screen, the clones should delete themselves.
Starting point file for this challenge

Your goal

Steps

1. Show the clone

Add a "when I start as a clone" to your obstacle. This is a "control" block. 

2. Add a "change X by __"

This is a dark blue "motion" block. It will tell the obstacle to move horizontally on the X axis. To go left, you'll need to change X by a negative number. 

3. Repeat the movement until the clone hits the other side of the screen

Put a "repeat until ___" block around the motion block. 

To check if it's on the other side of the screen, you'll need to build a longer block. First, put a green "operators" blocked called "__ <___" in the "until" blank. 

In the first green blank, drop a dark blue "x position" bubble. 

In the second green blank, type -230. -230 is the left side of the screen in Scratch. 

4. Delete the clone after the movement finishes

Put a "delete this clone" block, from the "control" section, after the repeat loop.