diff --git a/Cargo.toml b/Cargo.toml index 5d1ba5a..05233a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ bevy = { version = "0.12", default-features = false, features = [ "bevy_text", "bevy_ui", "multi-threaded", "png", "hdr", "x11", "bevy_gizmos", "tonemapping_luts", "default_font", "webgl2", ]} -bevy_asset_loader = { version = "0.18", features = [ "progress_tracking" ] } # Better asset loader +bevy_asset_loader = { version = "0.18", features = [ "progress_tracking", "2d" ] } # Better asset loader bevy_embedded_assets = { version = "0.9" } # Embed assets in binary bevy_kira_audio = { version = "0.18" } # Improved audio library iyes_progress = { version = "0.10", features = [ "assets" ] } # Track loading and game state diff --git a/assets/sprites/explosion_kenney.png b/assets/sprites/explosion_kenney.png new file mode 100644 index 0000000..2ef8ff7 Binary files /dev/null and b/assets/sprites/explosion_kenney.png differ diff --git a/assets/sprites/patterns_kenney.png b/assets/sprites/patterns_kenney.png new file mode 100644 index 0000000..d4acd07 Binary files /dev/null and b/assets/sprites/patterns_kenney.png differ diff --git a/assets/sprites/river_stix.aseprite b/assets/sprites/river_stix.aseprite new file mode 100644 index 0000000..ed2eee0 Binary files /dev/null and b/assets/sprites/river_stix.aseprite differ diff --git a/assets/sprites/river_stix.png b/assets/sprites/river_stix.png new file mode 100644 index 0000000..2823cec Binary files /dev/null and b/assets/sprites/river_stix.png differ diff --git a/assets/sprites/spirits_phlege.png b/assets/sprites/spirits_phlege.png new file mode 100644 index 0000000..a3a837d Binary files /dev/null and b/assets/sprites/spirits_phlege.png differ diff --git a/assets/sprites/spirits_stix.png b/assets/sprites/spirits_stix.png new file mode 100644 index 0000000..0a2bf6c Binary files /dev/null and b/assets/sprites/spirits_stix.png differ diff --git a/assets/sprites/ui_kenney.png b/assets/sprites/ui_kenney.png new file mode 100644 index 0000000..a5bc498 Binary files /dev/null and b/assets/sprites/ui_kenney.png differ diff --git a/src/game.rs b/src/game.rs index 8daadd2..0028ca2 100644 --- a/src/game.rs +++ b/src/game.rs @@ -17,7 +17,7 @@ const START_SCORES: [u32; 22] = [ 5000, 7000, 8500, ]; -const END_SCORES: [u32; 5] = [0, 50, 400, 3000, 9000]; +const END_SCORES: [u32; 5] = [0, 60, 350, 3000, 9000]; pub struct CharonPlugin; @@ -129,7 +129,7 @@ fn spawn_start_end( level_size.0.x += 2; level_size.0.y += 2; if let Ok(mut cam) = cam.get_single_mut() { - cam.target_zoom += 0.13; + cam.target_zoom += 0.3; } } let (offset, size) = play_to_real_size(&level_size); @@ -171,7 +171,7 @@ fn spawn_start_end( fn zoom_camera(mut cam: Query<(&mut OrthographicProjection, &GameCam)>) { if let Ok((mut proj, cam)) = cam.get_single_mut() { - proj.scale = lerp(proj.scale, 0.7 + cam.target_zoom, 0.01); + proj.scale = lerp(proj.scale, 0.9 + cam.target_zoom, 0.01); } } diff --git a/src/load.rs b/src/load.rs index 94aafa0..ec7735f 100644 --- a/src/load.rs +++ b/src/load.rs @@ -22,6 +22,7 @@ impl Plugin for LoadPlugin { fn build(&self, app: &mut App) { app.add_loading_state(LoadingState::new(GameState::Loading)) .init_collection::() + .add_collection_to_loading_state::<_, SpiritAssets>(GameState::Loading) .add_collection_to_loading_state::<_, TilemapAssets>(GameState::Loading) .add_plugins((ProgressPlugin::new(GameState::Loading) .continue_to(GameState::Menu) @@ -52,10 +53,21 @@ pub struct GameAssets { pub font: Handle, } +#[derive(AssetCollection, Resource)] +pub struct SpiritAssets { + #[asset(texture_atlas(tile_size_x = 72., tile_size_y = 72., columns = 6, rows = 1))] + #[asset(path = "sprites/spirits_stix.png")] + pub stix: Handle, + + #[asset(texture_atlas(tile_size_x = 72., tile_size_y = 72., columns = 4, rows = 1))] + #[asset(path = "sprites/spirits_phlege.png")] + pub phlege: Handle, +} + #[derive(AssetCollection, Resource)] pub struct TilemapAssets { - #[asset(path = "sprites/tiles.png")] - pub tiles: Handle, + #[asset(path = "sprites/river_stix.png")] + pub stix: Handle, } // ·········· diff --git a/src/spirits.rs b/src/spirits.rs index 12b163d..d7dd2e4 100644 --- a/src/spirits.rs +++ b/src/spirits.rs @@ -6,7 +6,7 @@ use rand::Rng; use crate::{ game::GameScore, - load::GameAssets, + load::{GameAssets, SpiritAssets}, tilemap::{get_neighbours, pos_to_tile, tile_to_pos, EndTile, PathTile, StartTile}, GameState, }; @@ -82,7 +82,7 @@ pub struct LoseText; fn spawn_spirit( mut cmd: Commands, time: Res