a
This commit is contained in:
parent
d163ceb291
commit
f6d7412744
94 changed files with 3836 additions and 1226 deletions
|
|
@ -215,8 +215,10 @@
|
|||
bounceInsideWorld(item, worldRef, opts);
|
||||
resolveFenceBounce(item, worldRef, dt, opts);
|
||||
const ice = (worldRef?.groundType || "soil") === "ice";
|
||||
const baseFriction = ice ? Math.max(Number(opts.frictionBase ?? 0.68), 0.93) : (opts.frictionBase ?? 0.68);
|
||||
const frictionRate = ice ? Math.min(Number(opts.frictionRate ?? 1), 0.55) : (opts.frictionRate ?? 1);
|
||||
let baseFriction = ice ? Math.max(Number(opts.frictionBase ?? 0.68), 0.93) : (opts.frictionBase ?? 0.68);
|
||||
let frictionRate = ice ? Math.min(Number(opts.frictionRate ?? 1), 0.55) : (opts.frictionRate ?? 1);
|
||||
const oilMul = global.TarinaiItemEnvironmentHazardSystem?.groundFrictionMultiplier?.(worldRef, item.x, item.y) ?? 1;
|
||||
if (oilMul < 1) baseFriction = 1 - (1 - baseFriction) * oilMul;
|
||||
const friction = Math.pow(baseFriction, dt * frictionRate);
|
||||
item.vx *= friction;
|
||||
item.vy *= friction;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue