body_2d

2D physics: a box (or a convex shape) that collides with tiles, slopes and other bodies. kind "player" runs and jumps from the controls (coyote time, jump buffering, variable jump height), "topdown" walks 8 ways from the controls with no gravity (pushes crates, picks up carry bodies with E), "projectile" flies at its velocity and reports "hit" on the first thing it meets (swept: never passes through), "actor" has gravity and is moved by its script (self.velocity), "dynamic" bounces and gets pushed, "solid" stands still or travels (moving platforms, blocks), "sensor" only reports overlaps (onEnter/onExit: coins, flags). Bumping a solid from below sends it "bumped".

In scene text

body_2d { kind "…"  size (0, 1, 0)  offset (0, 1, 0) }

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

Fields 38

FieldTypeUnit / rangeWhat it does
kindtext—"player", "topdown", "actor", "dynamic", "projectile", "solid" or "sensor".
size(x, y, z)unitsThe box (width, height); its bottom middle sits on the position.
offset(x, y, z)unitsMoves the box from the position.
solidtrue / false—Others stand on it and are stopped by it (always for "solid").
one_waytrue / false—Solid only from above: stand on it, jump up through it.
gravity_scalenumber0 … 10Gravity multiplier (0 floats).
run_speednumberunits/s, 0 … 100000Player: top running speed.
sprint_speednumberunits/s, 0 … 100000Player: top speed with the run button (Shift).
accelerationnumberunits/s², 0 … 1e+06Player: how fast it gets to speed.
decelerationnumberunits/s², 0 … 1e+06Player: how fast it stops when let go.
air_controlnumber0 … 1Player: share of acceleration in the air.
jump_heightnumberunits, 0 … 100000Player: a full jump's height; gravity follows from it and jump_time.
jump_timenumbers, 0.05 … 5Player: seconds to the top of a full jump.
fall_gravitynumber0.1 … 10Gravity multiplier while falling (snappy landings).
jump_cut_gravitynumber1 … 20Gravity multiplier while rising after jump is let go (tap: short hop).
max_fallnumberunits/s, 0 … 100000Fastest fall.
coyote_timenumbers, 0 … 1Player: a jump still works this long after running off a ledge.
jump_buffernumbers, 0 … 1Player: a press this long before landing still jumps.
climb_speednumberunits/s, 0 … 100000Player: speed on ladder tiles.
bouncenumber0 … 1Dynamic: bounciness.
frictionnumber0 … 100Dynamic: how fast it stops sliding on the ground.
travel(x, y, z)unitsMoving solid: its trip from the start (x, y); riders move with it.
periodnumbers, 0 … 10000Moving solid: seconds there and back (0: it stays).
animatetrue / false—Plays the sprite's clips from its movement: idle, run, jump, fall, climb (top-down: walk_up, walk_down, walk_side, idle_up...).
shapelist of text—Solid bodies: a convex outline instead of the box, points "x,y" in units from the position (["-40,0", "40,0", "0,60"]): rocks, ramps, slanted walls. Turns with rotation z.
max_slopenumberdeg, 0 … 89Platform movers: the steepest slope they walk up (steeper is a wall).
carrytrue / false—Top-down: can be picked up with the use key (E), carried overhead, put down or thrown (self.throw).
massnumber0.01 … 1000Water impact mass.
densitynumber0.05 … 10Density relative to water; 0.55 floats 55 percent submerged.
swim_speednumber0 … 2000Swimming speed from up/down or jump; 0 disables swimming.
breathnumber0 … 600Seconds of air underwater; 0 disables. Sends breath on exhaustion and recovery.
corner_correctionnumberunits, 0 … 64Player: clipping a ceiling's corner by up to this much while rising slides past it instead of ending the jump (0 off).
air_jumpsnumber0 … 10Player: extra jumps in the air (1: double jump); back on landing or touching a wall (0 off).
wall_slidenumberunits/s, 0 … 100000Player: holding toward a wall while falling slides down it this fast at most (0: no wall slide).
wall_jumpnumberunits/s, 0 … 100000Player: jump off a wall in the air, pushed away this fast (0: no wall jump).
dash_speednumberunits/s, 0 … 100000Player: the dash button (C / controller B) throws it this fast the way it points, gravity off for dash_time (0: no dash).
dash_timenumbers, 0.02 … 2Player: how long a dash lasts.
air_dashesnumber0 … 10Player: dashes in the air before landing again.
Arcwright Beta 2 (0.4.0) · generated from the engine source (25e375c86)Something wrong or missing? Tell us
Download Arcwright free