//import standard; import engine; import node; //util to generate and init a child node of a parent fn makeChild(parent: opaque, fname: string) { var child: opaque = loadNode(fname); parent.pushNode(child); child.initNode(); } //NOTE: root node can load the whole scene, and essentially act as the scene object fn onInit(node: opaque) { print "root.toy:onInit() called"; //make a child node.makeChild("scripts:/entity.toy"); //give the child a child // node.getNodeChild(0).makeChild("scripts:/entity.toy"); } fn onStep(node: opaque) { //print clock(); } fn onFree(node: opaque) { print "root.toy:onFree() called"; }