action_2d

2D: how an object takes part in action. One accepted hit (its anim_2d hit boxes touching another's hurt box, a stomp, or a script's self.hit) applies damage once and drives everything else: hit-stop on both sides, camera shake, the target's flash, knockback, a burst and a sound. Scripts get onMessage 'hurt' { damage, by, health, seq } and 'hit_landed' { target, seq }.

In scene text

action_2d { team "…"  health 1  damage 1 }

Add it in the Inspector (Add Component), in scene text as above, or ask your AI. Fields you leave out keep their defaults.

Fields 14

FieldTypeUnit / rangeWhat it does
teamtext—Hits never land on the same team ("player", "enemy"; empty: anyone but itself).
healthnumber0 … 1e+06Health (0: not tracked here; scripts keep their own). At 0 it gets onMessage 'defeated'.
damagenumber0 … 1e+06Damage its hits deal.
invulnerablenumbers, 0 … 10Seconds it can't be hit again after a hit lands on it.
hit_stopnumbers, 0 … 0.5Both sides pause on contact: light 0.033, medium 0.05, heavy 0.083.
world_stopnumbers, 0 … 0.5The whole world pauses on contact (exceptional impacts only).
shakenumberpx, 0 … 32Camera shake on contact in screen pixels (of a 720-line screen; virtual pixels in pixel art): 1 to 4.
shake_timenumbers, 0 … 2How long the shake lasts (0.08 to 0.18).
flashnumbers, 0 … 1Seconds the target's silhouette flashes (0.05 to 0.1).
flash_colorcolour (r, g, b)—The flash's colour.
knockback(x, y, z)units/sA hit's push on the target: (away from the attacker, up, 0).
bursttext—The burst at the contact: "spark", "dust", "slash", "poof", an image in Assets, or "" none.
soundtext—The sound of a hit landing ("" none).
squashnumber0 … 0.5Squash and stretch on landing and take-off, drawing only (its box never changes), with a dust puff on landing: 0 none, 0.15 lively.
Arcwright Beta 2 (0.4.0) · generated from the engine source (25e375c86)Something wrong or missing? Tell us
Download Arcwright free