pub struct Tuning {Show 78 fields
pub size: (i32, i32),
pub run_speed: f32,
pub sprint: bool,
pub sprint_speed: f32,
pub run_accel: f32,
pub turn_accel: f32,
pub run_decel: f32,
pub overspeed_decel: f32,
pub air_control: f32,
pub gravity: f32,
pub fall_gravity: f32,
pub apex_threshold: f32,
pub apex_gravity: f32,
pub max_fall: f32,
pub fast_fall: f32,
pub jump_speed: f32,
pub jump_boost: f32,
pub var_jump_time: f32,
pub jump_cut: f32,
pub coyote_time: f32,
pub jump_buffer: f32,
pub drop_through_time: f32,
pub air_jumps: u8,
pub double_jump_speed: f32,
pub double_var_jump_time: f32,
pub land_jump_lookahead: i32,
pub dashes: u8,
pub dash_eight_way: bool,
pub dash_speed: f32,
pub dash_time: f32,
pub dash_end_speed: f32,
pub dash_end_up: f32,
pub dash_cooldown: f32,
pub dash_buffer: f32,
pub dash_recharge_after: f32,
pub crystal_respawn: f32,
pub grab: bool,
pub slip_speed: f32,
pub tired_stamina: f32,
pub tired_slip_speed: f32,
pub stamina: f32,
pub climb_up_speed: f32,
pub climb_down_speed: f32,
pub climb_up_cost: f32,
pub climb_still_cost: f32,
pub climb_jump_cost: f32,
pub climb_hop_speed: f32,
pub wall_slide_speed: f32,
pub wall_jump_speed: f32,
pub wall_jump_lock: f32,
pub wall_jump_reach: i32,
pub wall_climb_speed: f32,
pub wall_climb_lock: f32,
pub wall_jump_aim: f32,
pub wall_refills_air_jumps: bool,
pub wall_refills_dashes: bool,
pub wall_stick_time: f32,
pub dive: bool,
pub glide: bool,
pub glide_fall_speed: f32,
pub super_dash: bool,
pub super_charge: f32,
pub super_speed: f32,
pub super_cancel_speed: f32,
pub run_roll: bool,
pub run_roll_speed: f32,
pub wings: bool,
pub dive_windup: f32,
pub dive_speed: f32,
pub dive_land_time: f32,
pub roll_drop: i32,
pub roll_speed: f32,
pub roll_time: f32,
pub roll_jump_after: f32,
pub hard_land_drop: i32,
pub hard_land_time: f32,
pub corner_correction: i32,
pub lift_boost: f32,
}Expand description
The movement feel. All lengths in units, speeds units/s, accelerations units/s², times seconds.
Fields§
§size: (i32, i32)The hitbox’s width and height in units (default 6x12, super::player::W x
super::player::H). The other numbers stay in units and don’t scale with it:
tuned for a 6x12 body on 8-unit tiles, a much bigger body may want a higher jump.
run_speed: f32Top running speed.
sprint: boolA sprint button exists.
sprint_speed: f32Top speed while sprinting.
run_accel: f32Acceleration toward the stick’s speed on the ground.
turn_accel: f32Acceleration when the stick points against the motion (turning around).
run_decel: f32Deceleration with the stick released.
overspeed_decel: f32Deceleration toward top speed when moving faster than it (after a roll jump or a dash), so momentum carries.
air_control: f32Multiplier on all horizontal acceleration in the air.
gravity: f32Gravity.
fall_gravity: f32Gravity multiplier while falling, for a heavier way down.
apex_threshold: f32Below this vertical speed (either way) with jump held, the hero is “at the apex”.
apex_gravity: f32Gravity multiplier at the apex with jump held: the hangtime.
max_fall: f32Terminal falling speed.
fast_fall: f32Terminal falling speed with down held.
jump_speed: f32Upward speed of a ground jump.
jump_boost: f32Horizontal speed added by a ground jump in the stick’s direction.
var_jump_time: f32Seconds after a jump during which holding jump keeps the full upward speed.
jump_cut: f32Releasing jump while rising multiplies the upward speed by this (1: no cut).
coyote_time: f32Seconds after leaving a ledge during which a ground jump still works.
jump_buffer: f32Seconds a jump press waits for the jump to become possible.
drop_through_time: f32Seconds after dropping through a platform during which platforms don’t hold.
air_jumps: u8Jumps available in the air before landing again.
double_jump_speed: f32Upward speed of an air jump.
double_var_jump_time: f32Hold window of an air jump, like Tuning::var_jump_time.
land_jump_lookahead: i32Falling with ground this many units below, a jump press waits for the landing (a queued ground jump) instead of spending the air jump.
dashes: u8Dashes available before touching ground or a crystal again (0: no dash).
dash_eight_way: boolDashes go eight ways; otherwise only sideways.
dash_speed: f32Speed during a dash.
dash_time: f32Length of a dash.
dash_end_speed: f32Speed handed over when a dash ends.
dash_end_up: f32Multiplier on the handed-over speed of upward dashes.
dash_cooldown: f32Seconds after a dash starts before another one can.
dash_buffer: f32Seconds a dash press waits for a dash to become possible.
dash_recharge_after: f32Seconds into a dash before the ground refills dashes (so dashing along the floor isn’t free).
crystal_respawn: f32Seconds before a used crystal comes back.
grab: boolGrabbing walls and climbing is possible at all.
slip_speed: f32Holding still on a wall slides down at this speed: 0 holds firm, more is a grip that slips.
tired_stamina: f32Below this stamina even a firm grip slips, at Tuning::tired_slip_speed.
tired_slip_speed: f32How fast a tired grip slips.
stamina: f32Stamina when full; climbing spends it, the ground refills it.
climb_up_speed: f32Climbing speed up a wall.
climb_down_speed: f32Climbing speed down a wall.
climb_up_cost: f32Stamina per second climbing up.
climb_still_cost: f32Stamina per second holding still on a wall.
climb_jump_cost: f32Stamina for a jump straight up a wall.
climb_hop_speed: f32Upward speed of the hop over the top of a wall.
wall_slide_speed: f32Terminal falling speed pressing into a wall without grabbing.
wall_jump_speed: f32Horizontal speed of a wall jump.
wall_jump_lock: f32Seconds after a wall jump during which the stick can’t pull back to the wall.
wall_jump_reach: i32A wall this many units away still counts for a wall jump.
wall_climb_speed: f32Horizontal speed of a wall jump made holding toward the wall: small, so the hero
arcs back onto the same wall (Hollow Knight, Super Meat Boy). Equal to
Tuning::wall_jump_speed to turn it off.
wall_climb_lock: f32Stick lock of such a wall jump. Between toward and away, speed and lock blend.
wall_jump_aim: f32How much stick up or down tilts a wall jump’s upward speed (0.15: +-15 %).
wall_refills_air_jumps: boolTouching a wall (sliding or holding on) gives the air jumps back.
wall_refills_dashes: boolTouching a wall gives the dashes back too.
wall_stick_time: f32Sliding down a wall, pressing away keeps the hero stuck to it this long, so “away + jump” becomes a wall jump instead of a fall.
dive: boolDiving is possible at all.
glide: boolGliding: a jump pressed in the air and held (after the air jump, if one is left) opens a cloak once falling.
glide_fall_speed: f32Terminal falling speed gliding.
super_dash: boolSuper dash (Hollow Knight’s Crystal Heart): hold to charge on the ground or on a wall, release when charged to fly straight and level until a wall or a cancel.
super_charge: f32Seconds to charge it.
super_speed: f32Flying speed.
super_cancel_speed: f32Horizontal speed kept when the flight is cancelled (jump or the button again).
run_roll: boolTapping down while running at speed rolls.
run_roll_speed: f32Horizontal speed needed for a roll from a run.
wings: boolPresentation: air jumps flap wings (Hollow Knight’s Monarch Wings) instead of a flip. Read by the hero’s animation driver, not by the movement.
dive_windup: f32Seconds hanging in the air before a dive plunges.
dive_speed: f32Speed of a dive.
dive_land_time: f32How long a dive’s impact takes away control.
roll_drop: i32Fall height in units from which a landing while moving becomes a roll.
roll_speed: f32Roll speed (the roll keeps any faster speed it lands with).
roll_time: f32Length of a roll.
roll_jump_after: f32Seconds into a roll before it can be cancelled into a jump.
hard_land_drop: i32Fall height in units from which a landing without moving is a hard landing.
hard_land_time: f32How long a hard landing takes away control.
corner_correction: i32Units the head may be nudged sideways around a ceiling corner.
lift_boost: f32How much of the speed of moving ground (or a moving wall held) a jump off it keeps:
1 all of it, 0 none. Kept for Tuning::coyote_time after leaving it.
Trait Implementations§
impl Copy for Tuning
impl StructuralPartialEq for Tuning
Auto Trait Implementations§
impl Freeze for Tuning
impl RefUnwindSafe for Tuning
impl Send for Tuning
impl Sync for Tuning
impl Unpin for Tuning
impl UnsafeUnpin for Tuning
impl UnwindSafe for Tuning
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.