From 392e495ad31a9ed2a25bae31d98c2f01a05193e2 Mon Sep 17 00:00:00 2001 From: zefad Date: Thu, 17 Sep 2026 21:49:07 +0200 Subject: [PATCH] reset modifs --- src/player.rs | 42 +++++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/src/player.rs b/src/player.rs index 18b56bd..20d94b5 100644 --- a/src/player.rs +++ b/src/player.rs @@ -1,10 +1,12 @@ use bevy::prelude::*; +use crate::collision::check_collision_with_player; use crate::collision::{Collider, HasCollided}; +use crate::obstacle::RegenerateObstacles; -const FALL_SPEED: f32 = 300.0; // Falling speed -const DIVE_SPEED: f32 = 700.0; // Falling speed sped up -const HORIZONTAL_SPEED: f32 = 300.0; // Lateral movement speed +const FALL_SPEED: f32 = 600.0; // Falling speed +const DIVE_SPEED: f32 = 1000.0; // Falling speed sped up +const HORIZONTAL_SPEED: f32 = 350.0; // Lateral movement speed pub const START_POSITION: Vec3 = Vec3::new(0.0, 0.0, 2.0); // Start position // The player @@ -15,6 +17,10 @@ pub struct Player; #[derive(Component)] pub struct Velocity(Vec2); +// Falling bool +#[derive(Resource, Default)] +pub struct FallStarted(pub bool); + // Spawn entity player fn spawn_player(mut commands: Commands) { commands.spawn(( @@ -33,12 +39,24 @@ pub(crate) fn move_player( input: Res>, time: Res