diff --git a/main.js b/main.js index a2e2ea1..a116c3c 100644 --- a/main.js +++ b/main.js @@ -148,7 +148,7 @@ async function run() { const width = 40; const height = 50; - const universe = Universe.new(width, height); + const universe = new Universe(width, height); const TIMEFACTOR = 10000.0; const MAX_DT = 2.0/Math.max(width, height); diff --git a/src/lib.rs b/src/lib.rs index c301b07..3f64d74 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,6 +22,7 @@ pub struct Universe { #[wasm_bindgen] impl Universe { + #[wasm_bindgen(constructor)] pub fn new(width: u32, height: u32) -> Self { Self { sys: (System::new(width, height), System::new(width, height)),