Function parameters are special variables created just for use in a function. Function parameters have two parts:

  • The parameter names are in the line that defines the function. Example: background_img and sprite_img.
  • The parameter values are in the call line. For example, "space" and "astronaut1".

This one function can create many different scenes by using new parameter values each time the function is called.

  • Try changing the parameter values to "fall" and "fox". Then click Run to see the changes.

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)