From 5efabde47609e69dbaef732ff39e5db8cf666b00 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Fri, 10 Feb 2023 18:42:01 +0000 Subject: [PATCH] Updated Toy --- Toy | 2 +- assets/scripts/entity.toy | 14 +++++++------- assets/scripts/root.toy | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Toy b/Toy index 53012db..aeb008c 160000 --- a/Toy +++ b/Toy @@ -1 +1 @@ -Subproject commit 53012dbce1a17292626568ca5a54325069ba20d6 +Subproject commit aeb008c6845fa5b791fd302a366a99adc3406880 diff --git a/assets/scripts/entity.toy b/assets/scripts/entity.toy index 82a13d8..4206550 100644 --- a/assets/scripts/entity.toy +++ b/assets/scripts/entity.toy @@ -24,7 +24,7 @@ fn getY(node: opaque) { //lifecycle functions fn onInit(node: opaque) { - print "render.toy:onInit() called"; + print "render.toy:onInit() called\n"; node.loadTexture("sprites:/character.png"); parent = node.getNodeParent(); @@ -36,13 +36,13 @@ fn onStep(node: opaque) { } fn onFree(node: opaque) { - print "render.toy:onFree() called"; + print "render.toy:onFree() called\n"; node.freeTexture(); } fn onDraw(node: opaque) { -// print "render.toy:onDraw() called"; +// print "render.toy:onDraw() called\n"; var px = parent.callNode("getX"); var py = parent.callNode("getY"); @@ -104,11 +104,11 @@ fn onKeyUp(node: opaque, event: string) { } fn onMouseMotion(node: opaque, x: int, y: int, xrel: int, yrel: int) { - // print "entity.toy:onMouseMotion(" + string x + ", " + string y + ", " + string xrel + ", " + string yrel + ")"; + // print "entity.toy:onMouseMotion(" + string x + ", " + string y + ", " + string xrel + ", " + string yrel + ")\n"; } fn onMouseButtonDown(node: opaque, x: int, y: int, button: string) { - // print "entity.toy:onMouseButtonDown(" + string x + ", " + string y + ", " + button + ")"; + // print "entity.toy:onMouseButtonDown(" + string x + ", " + string y + ", " + button + ")\n"; //jump to pos posX = x - WIDTH / 2; @@ -116,10 +116,10 @@ fn onMouseButtonDown(node: opaque, x: int, y: int, button: string) { } fn onMouseButtonUp(node: opaque, x: int, y: int, button: string) { - // print "entity.toy:onMouseButtonUp(" + string x + ", " + string y + ", " + button + ")"; + // print "entity.toy:onMouseButtonUp(" + string x + ", " + string y + ", " + button + ")\n"; } fn onMouseWheel(node: opaque, xrel: int, yrel: int) { - // print "entity.toy:onMouseWheel(" + string xrel + ", " + string yrel + ")"; + // print "entity.toy:onMouseWheel(" + string xrel + ", " + string yrel + ")\n"; } diff --git a/assets/scripts/root.toy b/assets/scripts/root.toy index fe8b6c7..2ae4ebc 100644 --- a/assets/scripts/root.toy +++ b/assets/scripts/root.toy @@ -11,7 +11,7 @@ fn _makeChild(parent: opaque, fname: string) { //NOTE: root node can load the whole scene, and essentially act as the scene object fn onInit(node: opaque) { - print "root.toy:onInit() called"; + print "root.toy:onInit() called\n"; //make a child node.makeChild("scripts:/entity.toy"); @@ -21,9 +21,9 @@ fn onInit(node: opaque) { } fn onStep(node: opaque) { - //print clock(); + //print clock() + "\n"; } fn onFree(node: opaque) { - print "root.toy:onFree() called"; + print "root.toy:onFree() called\n"; }