Added scene reloading & switching

This commit is contained in:
2023-03-03 16:05:48 +11:00
parent 4965cd492d
commit f9d0a27408
7 changed files with 92 additions and 59 deletions

View File

@@ -1,4 +1,5 @@
//the overarching scene
import engine;
import node;
//debugging tools
@@ -42,6 +43,13 @@ fn onDraw(node: opaque) {
stepCounter = 0;
}
fn onMouseButtonDown(node: opaque, x: int, y: int, button: string) {
//reload the scene on click
if (button == "left") {
loadRootNode("scripts:/scene.toy");
}
}
//global accessors
fn getTileWidth(node: opaque): int { return 64; }
fn getTileHeight(node: opaque): int { return 64; }