Screen Wrapping

If you test the project right now, the stars should scroll right off the screen and into oblivion, never to be seen again. If the star's x position is greater than the stage width, we need to reset the x position to 0 (just like we did with the bee). First, let's get the actions that actually move the star across the stage to run right after the newStar:MovieClip variable is set:

  1. First select the actions you want to move
  2. Click the Move Selected Actions Up button

Now start the if statement right after you set the x position:

  1. Click Statements > Conditions/Loops > if
  2. Type newStar._x>sW in the Condition box

Reset the x position of newStar to 0 using set variable:

If you test it now, you're going to see some wild and crazy action because the y position and scale are constantly resetting: