Step 4: Duplicate Background Code

Goal:


Now that background 1 has all of its code, we need to copy it into background2. We are doing this because they both have almost identical code, with just a few minor changes between them.

We are going to drag and drop the code from one sprite to another and then make changes to the second sprite’s code.

Steps:

  1. Left-Click and hold down on the when green flag clicked block (the rest of the code will follow) and drag it into the sprite called background2.
  2. From the sprite menu, select the one called background2.
  3. In the first go to x/y block, set Y to 463.

Code:


Click to replay