diff --git a/src/game.rs b/src/game.rs index 563e9cb..8b32be8 100644 --- a/src/game.rs +++ b/src/game.rs @@ -795,16 +795,16 @@ fn handle_race( if race.score >= RACE_SCORE_ACHIEVEMENT as f64 { ew_achievement.send(game::AchievementEvent::RaceScore); } - let difficulty = 2.0 * race.score as f64; - let mut delta = DVec3::new(0.0, 0.0, 100.0); - delta = (player_trans.rotation * delta.as_vec3()).as_dvec3(); - delta += DVec3::new( - (fastrand::f64() - 0.5) * difficulty, - (fastrand::f64() - 0.5) * difficulty, - (fastrand::f64() - 0.5) * difficulty, + let difficulty = 2.0 * race.score as f32; + let ring_slowdown = player_trans.rotation * (Vec3::Z * (-25.0 - difficulty)); + let mut delta = player_trans.rotation * (Vec3::Z * 100.0); + delta += Vec3::new( + (fastrand::f32() - 0.5) * difficulty, + (fastrand::f32() - 0.5) * difficulty, + (fastrand::f32() - 0.5) * difficulty, ); - *target_pos = Position(player_pos.0 + delta); - *target_v = *player_v; + target_pos.0 = player_pos.0 + delta.as_dvec3(); + target_v.0 = player_v.0 + ring_slowdown.as_dvec3(); *target_vis = Visibility::Inherited; commands.entity(target_entity).insert(RigidBody::Kinematic); }