End the match and hand back the controls
LIVE BOXING SCRIPT / G OF G
Append these final functions, select Keep global instance alive, then Apply / Save Script. Save the project. Return to page 6 to connect the starting verb or page 8 to check an existing setup.
func suspended():
return (not focused or get_tree().paused or Runtime.system_menu.is_open()
or not Runtime.active_system_gui_id.is_empty())func forget_keys():
held.clear()
if live and fighters[0].age >= READY:
defend(0, "")func _notification(what: int) -> void:
if what == NOTIFICATION_APPLICATION_FOCUS_OUT:
focused = false
forget_keys()
elif what == NOTIFICATION_PAUSED:
forget_keys()
elif what == NOTIFICATION_APPLICATION_FOCUS_IN:
focused = truefunc finish(message):
live = false
held.clear()
Runtime.hide_gui("spar")
Runtime.set_player_input_enabled(old_input)
if message != "":
pose(0, "idle")
pose(1, "idle")
Runtime.show_message(message)Losing focus clears held guard keys so the player cannot return with a key stuck down. With the play window active again, press the guard you want. A loss, draw or withdrawal leaves spar_won unset, and the next interaction restores both fighters to full health.
