Change poses and commit to the punch
LIVE BOXING SCRIPT / D OF G
Append these three functions. On either fighter, the chosen height forms part of the animation name. A low punch calls punch_low. A high guard calls guard_high.
func pose(i, clip):
Runtime.play_entity_animation(IDS[i], clip)func defend(i, lane):
var f = fighters[i]
if f.guard != lane:
f.guard = lane
pose(i, "idle" if lane == "" else "guard_" + lane)func punch(i, lane):
var f = fighters[i]
f.age = 0.0
f.lane = lane
f.guard = ""
f.spent = false
f.power = 2 if f.charge >= 0.80 else 1
f.charge = 0.0
pose(i, "punch_" + lane)The power of a punch is fixed when it starts. The charge immediately resets and begins to rebuild. The spent flag starts false so the glove can connect once during this swing. It becomes true on the first contact, even if the opponent blocks.
