Module 4 · In Studio · challenge 3 of 3 in this lesson
A new phase, Overtime, runs between Active and Cooldown (Active -> Overtime -> Cooldown -> Idle)
A test in Studio grades it and prints a pass code.
Open
Level 3, Professional
Challenge
Add an Overtime phase. This is the real test of a state machine: one new state, every transition still correct.
- Start from
- The game at milestone m06 (download)
- Grade it
- To grade work from an earlier milestone, apply your challenge changes to a checkout based on
m14-ship, which includes the Course Runner. In Studio, press Play, then rungame.ServerScriptService.RunGameTests:Invoke("round-loop", "round-overtime")in the server command bar. Copy the pass code from Output.
Done means
- A new phase, Overtime, runs between Active and Cooldown (Active -> Overtime -> Cooldown -> Idle)
- RoundPhase and RoundState publish Overtime like the other phases
- Overtime uses the same length as Active: Config.ROUND_SECONDS (40 s) normally, and the TestRoundSeconds override when it is set, never a hard-coded number
- During Overtime, the drone stays active and the beacon ProximityPrompt stays disabled; the drone clears when Cooldown starts
- The HUD shows Overtime too: Hud.luau's parsePhase accepts the new phase string, so the label does not stay stuck on Active
- The default suite still passes: the Idle wait in round_sequence and round_idle in tests/init.luau grows from 20 s to 36 s so it covers Active, Overtime and Cooldown
- challenges/round-loop.luau prints TEST PASS for overtime_order, overtime_length, overtime_drone and overtime_cooldown