--- a/src/game/ui/game_over_menu/systems/layout.rs +++ b/src/game/ui/game_over_menu/systems/layout.rs @@ -70,6 +70,8 @@ )); }); // Quit Button + // A web page cannot quit: the button is left out of the browser build. + #[cfg(not(target_arch = "wasm32"))] parent .spawn(( Button, --- a/src/game/ui/pause_menu/systems/layout.rs +++ b/src/game/ui/pause_menu/systems/layout.rs @@ -76,6 +76,8 @@ )); }); // Quit Button + // A web page cannot quit: the button is left out of the browser build. + #[cfg(not(target_arch = "wasm32"))] parent .spawn(( Button, --- a/src/main_menu/systems/layout.rs +++ b/src/main_menu/systems/layout.rs @@ -28,7 +28,7 @@ )); // Text parent.spawn(( - Text("Bevy Ball Game".to_string()), + Text("Star Scramble".to_string()), get_title_text_style(asset_server), TextLayout::justify(Justify::Center), )); @@ -55,6 +55,8 @@ )); }); // === Quit Button === + // A web page cannot quit: the button is left out of the browser build. + #[cfg(not(target_arch = "wasm32"))] parent .spawn(( Button, --- a/src/main.rs +++ b/src/main.rs @@ -17,9 +17,13 @@ fn main() { App::new() // Bevy Plugins - .add_plugins(DefaultPlugins.set(WindowPlugin { + .add_plugins(DefaultPlugins.set(bevy::asset::AssetPlugin { + // Browser build: no .meta files next to the assets, so do not ask the server for them. + meta_check: bevy::asset::AssetMetaCheck::Never, + ..default() + }).set(WindowPlugin { primary_window: Some(Window { - title: "Bevy Ball Game".to_string(), + title: "Star Scramble".to_string(), // On the web, size the canvas to its container (the itch.io iframe). fit_canvas_to_parent: true, ..default() --- a/src/systems.rs +++ b/src/systems.rs @@ -72,6 +72,8 @@ keyboard_input: Res>, mut app_exit_event_writer: MessageWriter, ) { + // A web page cannot quit: Escape does nothing in the browser build. + #[cfg(not(target_arch = "wasm32"))] if keyboard_input.just_pressed(KeyCode::Escape) { app_exit_event_writer.write(AppExit::Success); }