Skip to reading
Adventure Mechanics & Effects

Change poses and commit to the punch

Edition 0.86.3.4

Build authored boxing, camera moves, weather, attachments, inspectable objects, a radio and two-object puzzles using the existing adventure tools and scripts.

Download PDFView PDF page

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.

Code example
func pose(i, clip):
    Runtime.play_entity_animation(IDS[i], clip)
Code example
func defend(i, lane):
    var f = fighters[i]
    if f.guard != lane:
        f.guard = lane
        pose(i, "idle" if lane == "" else "guard_" + lane)
Code example
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.

Page 24 of 29Permalink
Go to page