STEP 4: You will duel the "computer" which will use the evil wizard! Let's set up a "health bar" for the computer.

  • Drag in another Integer Variable. Change its name to computer_hp and set its value to 100
  • Drag in another Variable Display. Change its name from my_display to computer_display.
  • Change the variable my_var to computer_hp and position the display at (-150, 200).
  • In the next activity we will begin to use the functions and link them together, starting with cast_spell()!

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)