Stateful Hero Energy Tracker

Date: ____________________
Assignment Title: Stateful Object Assignment

Assignment Prompt 1. Define a global object named myHero with name, power, and comment.
2. Subtract the selected amount of power whenever the hero trains.
3. Use conditional statements to update the coach's comment.
4. When power reaches zero or below, display an alert and reset power to 100.
5. Display the updated hero information after every action.

Hero Status

Initializing Captain Code...

Power: 100 / 100

Training Controls





High Power: 70–100
Medium Power: 40–69
Low Power: 1–39
Exhausted: 0 or below

Luau Console

Loading Luau runtime...