STEP 12: Now let's store the damage from casting a Rock Smash spell. It will work in the exact same way!

Remember that whenever we call a function that returns a value, we need to store that value to use it.

  • Find the rock_smash() function and look for this function call: calculate_damage(caster,·"rock_smash")
  • Add code to this line so that it looks like this: damage = calculate_damage(caster, "rock_smash")
  • Now that we have damage, why don't the HP variables decrease? We have a few more returns to do!

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)