34 lines
699 B
Rust
34 lines
699 B
Rust
#![allow(clippy::unused_unit)]
|
|
|
|
use std::panic;
|
|
|
|
use bracket_lib::prelude::*;
|
|
use state::State;
|
|
use wasm_bindgen::prelude::*;
|
|
|
|
pub mod components;
|
|
pub mod constants;
|
|
mod graphics;
|
|
pub mod input;
|
|
pub mod levels;
|
|
pub mod resources;
|
|
mod state;
|
|
pub mod systems;
|
|
pub mod tile_data;
|
|
|
|
#[wasm_bindgen(start)]
|
|
pub fn main_js() -> Result<(), JsValue> {
|
|
panic::set_hook(Box::new(console_error_panic_hook::hook));
|
|
let _ = main_common(false);
|
|
Ok(())
|
|
}
|
|
|
|
pub fn main_common(initialize_sound: bool) -> BError {
|
|
let context = BTermBuilder::vga(80, 25)
|
|
.with_fps_cap(60.0)
|
|
.with_title("Kroz")
|
|
.build()
|
|
.unwrap();
|
|
|
|
main_loop(context, State::new(initialize_sound))
|
|
}
|