ludic/packages/ludic.character/rules.ludic
Orkuncakilkaya e909ec122c feat(character): 16.8 - on land a physics walker moves the body (CharacterGround.walk); the package's own gravity, ballistic air and slope-probe refusal are gone
The package keeps the rules and hands them over each step: speed and heading, whether a jump
leaves, CHAR_STEP and the boots' slope limit. The walker (Jolt CharacterVirtual) does gravity,
landing, steps, slopes and following the ground down. Too steep is ground too steep facing the way
the body wanted to go; stepping off an edge is not. ludic.physics: phys_walker_move (follow the body
if something else moved it, then step), the slope limit, the jump always honoured. The character's
tests run on a real Jolt walker over the same fake world: 15 pass, a knee-high boulder now a step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 00:47:14 +03:00

53 lines
2.3 KiB
Text

# rules.ludic - the numbers that are the body's rules, and what it reports as facts
export const CHAR_STEP: float = 0.55 # a rise within this of the feet is a step, whatever its gradient
export const CHAR_BODY: float = 1.8 # feet to head
# what CharacterGround.walk says of the ground after a step (the same order as ludic.physics')
export const CHAR_WALK_GROUND: int = 0
export const CHAR_WALK_STEEP: int = 1
export const CHAR_WALK_UNSUPPORTED: int = 2
export const CHAR_WALK_AIR: int = 3
# how far a put-down spot's ground is measured round it (char_safe_spot)
export const CHAR_SLOPE_PROBE: float = 0.6
export const CHAR_BREATH_MAX: float = 45.0 # seconds of air under the surface
export const CHAR_WADE_MAX: float = 1.35 # a bed deeper than this under the surface is a swim
export const CHAR_STAND_UP: float = 1.15 # and shallower than this is ground again
export const CHAR_DROP: float = 1.5 # how far below the height left a put-down may be
export const CHAR_SIT_SEAT: int = 0 # a log, a stump, a bench
export const CHAR_SIT_GROUND: int = 1 # cross-legged in the grass
# who is holding the body still; two holders cannot release each other's hold
export const CHAR_HOLD_SCREEN: int = 1
export const CHAR_HOLD_STAGE: int = 2
# what sitting down where you stand answered
export const CHAR_SAT: int = 0
export const CHAR_STOOD: int = 1
export const CHAR_NOT_RIDING: int = 2
export const CHAR_NOT_AIRBORNE: int = 3
export const CHAR_NOT_STEEP: int = 4
export const CHAR_NOT_WET: int = 5
# what the first-person toggle answered
export const CHAR_EYES_ON: int = 0
export const CHAR_EYES_OFF: int = 1
export const CHAR_EYES_SITTING: int = 2
export const CHAR_EYES_RIDING: int = 3
# the facts
export const CHAR_LANDED: int = 0 # v: the speed carried out of the air
export const CHAR_JUMPED: int = 1
export const CHAR_FOOTFALL: int = 2 # a boot came down
export const CHAR_TOO_STEEP: int = 3 # a walk refused, once per refusal
export const CHAR_STARTED_SWIMMING: int = 4
export const CHAR_LEFT_WATER: int = 5
export const CHAR_OUT_OF_AIR: int = 6 # v: the seconds of it this frame
export const CHAR_CURRENT: int = 7 # the water at the edge takes the stroke; said every 12 s
export property CharacterFact {
what: int = 0
x: float = 0.0
y: float = 0.0
z: float = 0.0
v: float = 0.0
}