STEP 4: Let's change the x-coordinate each time the loop runs so that our lilypads all appear at different locations.

We use add value to change a variable inside a loop. The first lilypad will start with an x-coordinate of -200. Each time the loop runs, it will add 100 pixels to the x-coordinate. the next one will appear at -100, then 0, and so on.

  • Go to and drag Add Value inside the loop.
  • Add 100 to x each time the loop runs. To do this change the variable to x and change the added value to 100.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)