Set the timing and starting health
LIVE BOXING SCRIPT / A OF G
Create one native GDScript record with ID spar_rules. Begin with the dark block below. Append the next six dark blocks in order in the same editor. Copy only the code. PCA supplies the surrounding script class. Keep each func at the far left and retain the indented lines below it.
const IDS = ["hero", "porter"]
const WIND = 0.24
const END_HIT = 0.36
const READY = 0.56
var live = false
var room_stamp = -1
var game_stamp = -1
var old_input = true
var focused = true
var dimension = 0
var fighters = []
var held = []
var next_attack = 0.0
var report = ""
var drawn = ""func fighter():
return {"hp":6, "charge":1.0, "power":1, "age":READY,
"lane":"", "guard":"", "spent":false}The three timing numbers are seconds#
WIND ends the windup. END_HIT ends the part that can score. READY ends recovery. Keep these in increasing order. Both fighters use the same clock settings. Change the names in IDS if you kept different scene IDs. The player is first and the opponent is second.
Both fighters start with six health and a full power meter. In the script, the word “lane” means high or low, and “age” means the time since that fighter last started a punch.
