STEP 3: You, the user, will be the player sprite. Let's add a "health bar" to keep track of your wizard's health!

  • Go to LOGIC and . Drag out Integer Variable to the bottom of the MAIN CODE section.
  • Change the variable's name to player_hp and change its value to 100.
  • Add Variable Display to the next line. Change the display's name from my_display to player_display.
  • Change the variable in the display from my_var to player_hp and position the display at (150, 200).

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)