Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/map/sproinger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const COOLDOWN: f32 = 0.75;
const TRIGGER_WIDTH: f32 = 32.0;
const TRIGGER_HEIGHT: f32 = 8.0;

const FORCE: f32 = 35.0;
const FORCE: f32 = 25.0;

#[derive(Default)]
pub struct Sproinger {
Expand Down
11 changes: 10 additions & 1 deletion src/player/character.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,18 @@ pub struct PlayerCharacterMetadata {
/// This is the float gravity factor of the player character
#[serde(default = "PlayerCharacterMetadata::default_float_gravity_factor")]
pub float_gravity_factor: f32,
/// This is the gravity of the player character
#[serde(default = "PlayerCharacterMetadata::default_gravity")]
pub gravity: f32,
}

impl PlayerCharacterMetadata {
const DEFAULT_HEAD_THRESHOLD: f32 = 24.0;
const DEFAULT_LEGS_THRESHOLD: f32 = 42.0;

const DEFAULT_JUMP_FORCE: f32 = 15.0;
const DEFAULT_GRAVITY: f32 = 1.0;

const DEFAULT_JUMP_FORCE: f32 = 9.5;
const DEFAULT_MOVE_SPEED: f32 = 5.0;
const DEFAULT_SLIDE_SPEED_FACTOR: f32 = 3.0;
const DEFAULT_SLIDE_DURATION: f32 = 0.1;
Expand Down Expand Up @@ -145,4 +150,8 @@ impl PlayerCharacterMetadata {
pub fn default_hat_mount() -> Vec2 {
vec2(Self::DEFAULT_HAT_MOUNT_X, Self::DEFAULT_HAT_MOUNT_Y)
}

pub fn default_gravity() -> f32 {
Self::DEFAULT_GRAVITY
}
}
1 change: 1 addition & 0 deletions src/player/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ pub fn spawn_player(
size: character.collider_size,
has_friction: false,
can_rotate: false,
gravity: character.gravity,
..Default::default()
};

Expand Down