Implement hitstun and knockback.

This commit is contained in:
2026-09-13 23:01:25 +02:00
parent 811578af2f
commit 4570860d64
26 changed files with 840 additions and 246 deletions
+5 -5
View File
@@ -18,11 +18,11 @@ pub fn apply_air_drift(
velocity.x += (-velocity_sign) * attribs.air_friction;
}
} else {
let target_velocity =
input.get_last_frame().movement.x * attribs.air_drift_max;
let mut acceleration =
input.get_last_frame().movement.x.signum() * attribs.air_acceleration_base + input.get_last_frame().movement.x * attribs.air_acceleration_stick;
let target_velocity = input.get_last_frame().movement.x * attribs.air_drift_max;
let mut acceleration = input.get_last_frame().movement.x.signum()
* attribs.air_acceleration_base
+ input.get_last_frame().movement.x * attribs.air_acceleration_stick;
// Acceleration opposes velocity
if acceleration * velocity.x < 0 {
// do nothing