diff --git a/Cargo.toml b/Cargo.toml index 6ea81a1..4c60722 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "flappyspace" -version = "1.0.0" +version = "1.0.1" edition = "2021" description = "A small game about a little UFO dodging asteroids built in Bevy" readme = "README.md" diff --git a/src/consts.rs b/src/consts.rs index 25931c9..40d2483 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -8,10 +8,10 @@ pub const TOP_BOUND: f32 = 425.; pub const BOTTOM_BOUND: f32 = -TOP_BOUND; /// Number that the ship's velocity is being decreased by every frame -pub const GRAVITY: f32 = 40.; +pub const GRAVITY: f32 = 35.; /// Number that the ship's velocity gets set to after a jump -pub const JUMP_VELOCITY: f32 = 500.; +pub const JUMP_VELOCITY: f32 = 450.; diff --git a/src/game.rs b/src/game.rs index e1ed6b6..31b5a5e 100644 --- a/src/game.rs +++ b/src/game.rs @@ -127,8 +127,8 @@ fn update_ship( ship.velocity -= GRAVITY; // Rotates ship according to velocity - // The factor 0.0005 is chosen randomly but looks convenient - transform.rotation = Quat::from_rotation_z(0.0005 * ship.velocity); + // The factor 0.00075 is chosen randomly but looks convenient + transform.rotation = Quat::from_rotation_z(0.00075 * ship.velocity); // Checks for input (Space) and applies increased velocity if key.just_pressed(KeyCode::Space) { @@ -153,6 +153,7 @@ fn update_ship( fn check_collisions( mut commands: Commands, mut ship_query: Query<(&mut TextureAtlasSprite, &Transform), With>, + mut score_text_query: Query<&mut Text, With>, mut game_state: ResMut>, assets: Res, rock_query: Query<&Transform, With> @@ -178,6 +179,8 @@ fn check_collisions( ).is_some() { // Changes ship sprite to broken ship sprite.index = 0; + // Changes color of the scoreboard to make it more visible + score_text_query.single_mut().sections[0].style.color = Color::RED; play_sound(&mut commands, &assets, "crash"); game_state.set(GameState::Crashed); }