Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
davidromani committed Oct 10, 2024
2 parents 2569ec7 + 451f628 commit 799be6d
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 34 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
Changelog
=========

##### Version 0.07.000 (WIP)
##### Version 0.07.001 (WIP)

* keep working

##### Version 0.07.000 (2024-10-10)

* fix un-paused sfx on ship landing problem
* spawn intro music audio bundle on menu
* improve ship_air_scape sfx loop effect
* add CREDITS.md

##### Version 0.06.000 (2024-10-09)

* fix "Out of fuel" message
Expand Down
22 changes: 22 additions & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CREDITS
=======

### Acknowledgements

Boris Boutillier\
[GitHub](https://github.com/BorisBoutillier)

### Music & Sound Effects

Tomàs Simón\
[Website](https://www.tomasimon.com)

### Pixel Art & Graphics

Adan Príncep\
[Instagram](https://www.instagram.com/adan_princep)

### Code

David Romaní\
[GitHub](https://github.com/davidromani)
38 changes: 19 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rusty-lander"
version = "0.6.0"
version = "0.7.0"
edition = "2021"
license = "MIT"
authors = ["David Romaní <[email protected]>"]
Expand All @@ -16,7 +16,7 @@ bevy_hanabi = { version = "0.12", default-features = false, features = ["2d"] }
iyes_perf_ui = "0.3"
leafwing-input-manager = "0.15"
rand = "0.8"
svg = "0.17"
svg = "0.18"

[workspace]
resolver = "2" # Important! wgpu/Bevy needs this!
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Rusty Lander v0.6
Rusty Lander v0.7
=================

A Jupiter Lander video game remake made with Rust & Bevy ECS game engine.
Expand All @@ -16,7 +16,7 @@ A Jupiter Lander video game remake made with Rust & Bevy ECS game engine.
```bash
$ git clone [email protected]:davidromani/rusty-lander.git
$ cd rusty-lander
$ cargo run
$ cargo run --release
```

### Game instructions
Expand Down
2 changes: 2 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ TODO
* animate refuel bar after landing
* make high score persistent
* pan camera when the spaceship is close to the platform
* add shake camera effect on spaceship crash
* add gamepad controller
* add music
* add Windows compiled binary
Binary file added assets/audios/music_intro.ogg
Binary file not shown.
Binary file modified assets/audios/ship_air_scape.ogg
Binary file not shown.
Binary file modified assets/audios/ship_explosion.ogg
Binary file not shown.
Binary file modified assets/audios/ship_thruster.ogg
Binary file not shown.
2 changes: 2 additions & 0 deletions src/asset_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ fn load_audio_assets_system(mut commands: Commands, asset_server: Res<AssetServe
ship_air_scape: asset_server.load("audios/ship_air_scape.ogg"),
ship_thruster: asset_server.load("audios/ship_thruster.ogg"),
ship_explosion: asset_server.load("audios/ship_explosion.ogg"),
music_intro: asset_server.load("audios/music_intro.ogg"),
});
}

Expand All @@ -95,6 +96,7 @@ pub struct AudioAssets {
pub ship_air_scape: Handle<AudioSource>,
pub ship_thruster: Handle<AudioSource>,
pub ship_explosion: Handle<AudioSource>,
pub music_intro: Handle<AudioSource>,
}

// States
Expand Down
35 changes: 26 additions & 9 deletions src/game.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
use crate::asset_loader::{AudioAssets, SceneAssets, UiAssets};
use crate::collider::Platform;
use crate::menu::BLACK_COLOR;
use crate::spaceship::{AirScapeSoundEffect, Player, ThrusterSoundEffect};
use crate::state::{AppState, GameState};
use crate::WINDOW_HEIGHT;
use avian2d::prelude::{GravityScale, LinearVelocity};
use bevy::app::AppExit;
use bevy::audio::PlaybackMode;
use bevy::input::common_conditions::*;
use bevy::prelude::*;
use bevy::text::Text2dBounds;
use rand::prelude::*;
use std::f32::consts::TAU;

use crate::asset_loader::{SceneAssets, UiAssets};
use crate::collider::Platform;
use crate::menu::BLACK_COLOR;
use crate::spaceship::Player;
use crate::state::{AppState, GameState};
use crate::WINDOW_HEIGHT;

pub const FUEL_QUANTITY: f32 = 1000.0;
const INFO_PANEL_WIDTH: f32 = 400.0;
const INFO_PANEL_HEIGHT: f32 = 110.0;
Expand All @@ -33,7 +33,7 @@ impl Plugin for GamePlugin {
.add_event::<OutOfFuelEvent>()
.add_systems(
OnEnter(AppState::Menu),
spawn_rusty_planet_menu_background_image_system,
spawn_rusty_planet_menu_background_image_and_intro_music_system,
)
.add_systems(
OnEnter(AppState::Game),
Expand All @@ -56,11 +56,19 @@ impl Plugin for GamePlugin {
// Systems
fn catch_spaceship_just_landed_event_system(
assets: ResMut<UiAssets>,
air_scape_sound_controller: Query<&AudioSink, With<AirScapeSoundEffect>>,
thruster_sound_controller: Query<&AudioSink, With<ThrusterSoundEffect>>,
mut events_reader: EventReader<SpaceshipJustLandedEvent>,
mut spaceship_gravity_query: Query<&mut GravityScale, With<Player>>,
mut commands: Commands,
mut scores: ResMut<Scores>,
) {
if let Ok(sink) = air_scape_sound_controller.get_single() {
sink.pause();
}
if let Ok(sink) = thruster_sound_controller.get_single() {
sink.pause();
}
for event in events_reader.read() {
let platform = event.platform.clone();
let linear_velocity = event.linear_velocity.clone();
Expand Down Expand Up @@ -306,9 +314,10 @@ fn spawn_scores_text_system(mut commands: Commands, assets: ResMut<UiAssets>, sc
));
}

fn spawn_rusty_planet_menu_background_image_system(
fn spawn_rusty_planet_menu_background_image_and_intro_music_system(
mut commands: Commands,
scene_assets: Res<SceneAssets>,
audio_assets: Res<AudioAssets>,
) {
commands.spawn((
StateScoped(AppState::Menu),
Expand All @@ -320,6 +329,14 @@ fn spawn_rusty_planet_menu_background_image_system(
},
..default()
},
AudioBundle {
source: audio_assets.music_intro.clone(),
settings: PlaybackSettings {
mode: PlaybackMode::Loop,
..default()
},
..default()
},
));
}

Expand Down
2 changes: 1 addition & 1 deletion src/menu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ fn spawn_credits_menu(mut commands: Commands, assets: ResMut<UiAssets>) {
},
),
TextSection::new(
"ca.tomasimon.com",
"www.tomasimon.com",
TextStyle {
font: assets.font_fira.clone(),
font_size: 20.0,
Expand Down

0 comments on commit 799be6d

Please sign in to comment.