STEP 14: When a wizard casts a Rock Smash spell, rock_smash() will also need to return damage.

  • Drag another Return Statement inside and to the bottom of rock_smash().
  • Change the variable name from my_var to damage. This will return damage to where we call rock_smash().

We have now set it up so that each spell stores the calculated damage and returns it. Where do we call the spell functions? That is where we will need to store the returned damage value.

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)