diff --git a/src/main.rs b/src/main.rs index 80b3394..32e2978 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,7 +14,7 @@ pub use assets::GameAssets; use bevy::asset::AssetMetaCheck; use bevy::prelude::*; -use bevy::window::{PresentMode, Window, WindowMode}; +use bevy::window::{PresentMode, Window, WindowMode, WindowResolution}; use bevy_asset_loader::prelude::*; use bevy_rapier2d::prelude::*; @@ -44,7 +44,9 @@ fn main() { primary_window: Some(Window { present_mode: PresentMode::Fifo, mode: WindowMode::Windowed, - fit_canvas_to_parent: true, + fit_canvas_to_parent: false, + canvas: Some("#game-canvas".to_string()), + resolution: WindowResolution::new(1280.0, 720.0), ..default() }), ..default() diff --git a/src/ui/pop_up.rs b/src/ui/pop_up.rs index 172ae05..79af8e5 100644 --- a/src/ui/pop_up.rs +++ b/src/ui/pop_up.rs @@ -101,10 +101,7 @@ impl Plugin for PopUpPlugin { fn build(&self, app: &mut App) { app.add_systems( Update, - ( - spawn_pop_ups.run_if(in_state(GameState::Gaming)), - despawn_pop_ups, - ), + (spawn_pop_ups, despawn_pop_ups).run_if(in_state(GameState::Gaming)), ); } } diff --git a/src/world/camera.rs b/src/world/camera.rs index 9cff7ee..d808e9d 100644 --- a/src/world/camera.rs +++ b/src/world/camera.rs @@ -13,7 +13,6 @@ use crate::player::Player; #[cfg(not(target_arch = "wasm32"))] use crate::player::PlayerState; use crate::spell::debug_spell::DebugSpell; -use crate::GameState; // How much `1.0` in bevy coordinates translates to the pixels of a sprite. // Only relevant for the ysorting. @@ -129,7 +128,7 @@ impl Plugin for CameraPlugin { zoom_camera, ), ) - .add_systems(OnEnter(GameState::Gaming), spawn_camera) + .add_systems(Startup, spawn_camera) .add_systems( PostUpdate, update_camera_target diff --git a/wasm/index.html b/wasm/index.html index b4dae94..5f23d21 100644 --- a/wasm/index.html +++ b/wasm/index.html @@ -8,14 +8,13 @@
-
+