Goal:
Our targets will move side to side forever during the game.
In our code, we want the easy target to constantly move to the right until it reaches the edge of the screen. Therefore we need to move it in the positive x direction.
Once it reaches the end of the screen it will move to the left edge of the screen. Now we need to move it in the negative x direction.
Steps:
- Stay on the “Easy Target” sprite
- From Motion, place a change x by block. Change the number to 5
- From Control, place an if statement
- From Operators, place a >(greater than) block inside the If block
- From Motion, place the set x position block on the left side and change the number on the right side to 230
- From Motion, place a set x to and change the number to -210