Implement hitstun and knockback.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user