Skip to content

Commit 972f968

Browse files
committed
feat: run from main.lua
1 parent 154614b commit 972f968

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/main.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,17 @@ use std::{fs::File, path::Path};
1010
fn main() -> LuaResult<()> {
1111
let lua = init();
1212
lua.load(Path::new("main.lua")).exec()?;
13-
14-
game_loop(&60.0, || {}, |dt| {});
15-
13+
game_loop(
14+
&60.0,
15+
|| match lua.load("loom.tick()").exec() {
16+
Ok(()) => (),
17+
Err(_) => (),
18+
},
19+
|dt| match lua.load(format!("loom.frame({})", dt)).exec() {
20+
Ok(()) => (),
21+
Err(_) => (),
22+
},
23+
);
1624
Ok(())
1725
}
1826

0 commit comments

Comments
 (0)