Step 2: Background Move

Goal:


Now that we have our background exactly where we want it when we start, we now need to tell it how to move.

Our background is going to be forever moving towards the bottom of the screen. Once it reaches the bottom it will teleport back to the top. This works because we have 2 backgrounds that we will program to move at the same speed so they will move together and you will never see a gap between them.

Let’s start by telling the background how fast to move and beginning the check to see if it is at the bottom of the screen.

Steps:

  1. From Control, place a forever block.
  2. From Motion, place a change y by block and set the amount to -5.
  3. From Control, place an IF statement block.
  4. From Operators, place a <(Less Than) block, and set the right side to -340.

Code:


Click to replay