#[cfg(target_arch = "wasm32")] extern crate console_error_panic_hook; use bevy::{ input::{ keyboard::KeyboardInput, mouse::{MouseButtonInput, MouseMotion, MouseWheel}, }, prelude::*, }; fn main() { #[cfg(target_arch = "wasm32")] { std::panic::set_hook(Box::new(console_error_panic_hook::hook)); console_log::init_with_level(log::Level::Debug).expect("cannot initialize console_log"); } App::build() .add_resource(WindowDescriptor { width: 300, height: 300, ..Default::default() }) .add_default_plugins() // One time greet .add_startup_system(hello_wasm_system.system()) // Track ticks (sanity check, whether game loop is running) .add_system(counter.system()) // Track input events .init_resource::() .add_system(track_input_events.system()) .run(); } fn hello_wasm_system() { log::info!("hello wasm"); } fn counter(mut state: Local, time: Res