wip(0.S3): the packages migrated by ludic migrate state packages - every package test green
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1e8b5b0523
commit
07505e7ef2
294 changed files with 14996 additions and 14675 deletions
|
|
@ -1,22 +1,22 @@
|
|||
# swim.ludic - afloat: buoyancy, the descent, the breath, and the shore stopping the body
|
||||
function chr_swim_tick(dx: float, dz: float, jump: bool, dt: float) -> void {
|
||||
function chr_swim_tick(base_st: mut BaseState, character_st: mut CharacterState, dx: float, dz: float, jump: bool, dt: float) -> void {
|
||||
# standing still out here is floating, not swimming
|
||||
if Math.abs(dx) + Math.abs(dz) > 0.05 { chr_float = 0.0 } else { chr_float = Math.min(1.0, chr_float + dt / 1.5) }
|
||||
chr_dive_tick(jump, dt)
|
||||
chr_breath_tick(dt)
|
||||
chr_current_tick(dt)
|
||||
let step = chr_speed * dt
|
||||
if Math.abs(dx) + Math.abs(dz) > 0.05 { character_st.chr_float = 0.0 } else { character_st.chr_float = Math.min(1.0, character_st.chr_float + dt / 1.5) }
|
||||
chr_dive_tick(character_st, jump, dt)
|
||||
chr_breath_tick(base_st, character_st, dt)
|
||||
chr_current_tick(base_st, character_st, dt)
|
||||
let step = character_st.chr_speed * dt
|
||||
if step > 0.0 {
|
||||
chr_push(chr_x - Math.sin(chr_yaw) * step, chr_z - Math.cos(chr_yaw) * step, 0.35, chr_y, chr_y + CHAR_BODY)
|
||||
let mx = chr_out_x - chr_x
|
||||
let mz = chr_out_z - chr_z
|
||||
chr_step = Math.sqrt(mx * mx + mz * mz)
|
||||
chr_x = chr_out_x
|
||||
chr_z = chr_out_z
|
||||
chr_push(character_st, character_st.chr_x - Math.sin(character_st.chr_yaw) * step, character_st.chr_z - Math.cos(character_st.chr_yaw) * step, 0.35, character_st.chr_y, character_st.chr_y + CHAR_BODY)
|
||||
let mx = character_st.chr_out_x - character_st.chr_x
|
||||
let mz = character_st.chr_out_z - character_st.chr_z
|
||||
character_st.chr_step = Math.sqrt(mx * mx + mz * mz)
|
||||
character_st.chr_x = character_st.chr_out_x
|
||||
character_st.chr_z = character_st.chr_out_z
|
||||
}
|
||||
# the surface, with a slow bob so a floating body is not a statue on glass
|
||||
let bob = 0.04 * Math.sin(chr_time * 3.8)
|
||||
chr_y = chr_water - 0.30 + bob - chr_depth
|
||||
let bob = 0.04 * Math.sin(character_st.chr_time * 3.8)
|
||||
character_st.chr_y = character_st.chr_water - 0.30 + bob - character_st.chr_depth
|
||||
# shallow enough to stand up in, and at the top rather than under it
|
||||
if chr_bed_depth(chr_x, chr_z) < CHAR_STAND_UP and chr_depth < 0.2 { chr_leave_water() }
|
||||
if chr_bed_depth(character_st.chr_x, character_st.chr_z) < CHAR_STAND_UP and character_st.chr_depth < 0.2 { chr_leave_water(base_st, character_st) }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue