diff --git a/README.md b/README.md index db52e9f..53a6db5 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ The `SPACE` key helps you move more intuitively by slowing you down. Hold it fo When you're ready, take a look around, explore the starting area. There is a friendly person floating nearby in a red space suit that would love to talk to you. +The game is a bit dark, since it's meant to be played in the night. But maybe you're unlucky and you start with a planet or moon eclipsing the sun, making everything extra dark. (Yes, all celestial objects move in real time and have different positions depending on when you play.) If it's too dark, try the flashlight (`f` key), turning off the shadows in the menu, and make sure that Augmented Reality is on (`TAB` key) which gives you a little extra light amplification. + Press the `ESC` key for the menu to restart the game if you get lost, explore more key bindings, game features, and the **achievements** to get some guidance on what you can do in the game. But in the end, OutFly is an open world game with no true goals other than the ones you set for yourself. Just lean back, get cozy, and drift towards whatever catches your eye :) diff --git a/src/actor.rs b/src/actor.rs index 81c4151..f83c529 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -30,8 +30,9 @@ impl Plugin for ActorPlugin { ( update_physics_lifeforms, update_power, + handle_gravity, handle_wants_maxrotation, - handle_wants_maxvelocity, + handle_wants_maxvelocity.run_if(any_with_component::), handle_wants_lookat.run_if(alive), ), ); @@ -118,6 +119,7 @@ pub struct ExperiencesGForce { pub visual_effect_threshold: f32, pub visual_effect: f32, pub last_linear_velocity: DVec3, + pub gravitational_component: DVec3, pub ignore_gforce_seconds: f32, } impl Default for ExperiencesGForce { @@ -127,8 +129,9 @@ impl Default for ExperiencesGForce { damage_threshold: 100.0, visual_effect_threshold: 20.0, visual_effect: 0.0, - last_linear_velocity: DVec3::splat(0.0), - ignore_gforce_seconds: 0.0, + last_linear_velocity: DVec3::ZERO, + gravitational_component: DVec3::ZERO, + ignore_gforce_seconds: 0.01, } } } @@ -156,7 +159,11 @@ pub struct WantsMaxVelocity(pub f64); #[derive(Component)] pub struct WantsToLookAt(pub String); #[derive(Component)] +pub struct WantsMatchVelocityWith(pub String); +#[derive(Component)] pub struct Identifier(pub String); +#[derive(Component)] +pub struct OrbitsJupiter; #[derive(Component)] pub struct LifeForm { @@ -535,25 +542,53 @@ fn handle_wants_maxrotation( } } +/// Slows down NPC's movement until they reach their target velocity. fn handle_wants_maxvelocity( time: Res