wip(0.S3): packages and examples migrated again from their pre-0.S sources in one run

ludic migrate state packages <every example program> packages/ludic.lab/example/plate.ludic
  1804 vars into 126 states, 64 into lets; 23498 edits in 460 files

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 15:31:34 +03:00
parent 5ffe50ed02
commit 19fcf60599
459 changed files with 17862 additions and 17603 deletions

View file

@ -10,25 +10,23 @@ export function char_stand_at(x: float, z: float, from_y: float) -> float {
# A step up and a slope up are different refusals. Within CHAR_STEP of the feet is a step, taken
# whatever the gradient into it (a 45 cm deck arrives in one frame); above that the boots decide,
# measured over CHAR_SLOPE_PROBE, so the frame rate never changes the answer.
export function char_slope_blocks(nh: float, fx: float, fz: float) -> bool {
if nh - chr_y > CHAR_STEP { return true }
let sx = chr_x + fx * CHAR_SLOPE_PROBE
let sz = chr_z + fz * CHAR_SLOPE_PROBE
return CharacterGround.height(sx, sz) - chr_y > CHAR_SLOPE_PROBE * CharacterGround.slope_limit()
export function char_slope_blocks(character_st: CharacterState, nh: float, fx: float, fz: float) -> bool {
if nh - character_st.chr_y > CHAR_STEP { return true }
let sx = character_st.chr_x + fx * CHAR_SLOPE_PROBE
let sz = character_st.chr_z + fz * CHAR_SLOPE_PROBE
return CharacterGround.height(sx, sz) - character_st.chr_y > CHAR_SLOPE_PROBE * CharacterGround.slope_limit()
}
# a body of radius r at (x, z) from y0 to y1, out of every collider: the resolved point is chr_out_*
var chr_out_x: float = 0.0
var chr_out_z: float = 0.0
function chr_push(x: float, z: float, r: float, y0: float, y1: float) -> bool {
chr_ask_x = x
chr_ask_z = z
function chr_push(character_st: mut CharacterState, x: float, z: float, r: float, y0: float, y1: float) -> bool {
character_st.chr_ask_x = x
character_st.chr_ask_z = z
let hit = CharacterGround.push(x, z, r, y0, y1)
chr_out_x = x
chr_out_z = z
character_st.chr_out_x = x
character_st.chr_out_z = z
if hit {
chr_out_x = CharacterGround.pushed_x()
chr_out_z = CharacterGround.pushed_z()
character_st.chr_out_x = CharacterGround.pushed_x()
character_st.chr_out_z = CharacterGround.pushed_z()
}
return hit
}