Moved more polyfill code into the engine proper

This commit is contained in:
2023-02-28 04:22:37 +11:00
parent 479e38d492
commit d3a3896efe
10 changed files with 139 additions and 67 deletions

View File

@@ -0,0 +1,30 @@
import node;
//util to generate and init a child node of a given parent
fn makeChild(parent: opaque, fname: string) {
var child: opaque = loadNode(fname);
parent.pushNode(child);
child.initNode();
return child;
}
fn onInit(node: opaque) {
for (var i = 0; i < 20; i++) {
node.makeChild("scripts:/tilemap/tile.toy");
}
node.freeChildNode(10);
var n = node.getChildNode(10);
for (var i = 0; i < 20; i++) {
//this would originally prune tombstones...
node.makeChild("scripts:/tilemap/tile.toy");
}
print node.getChildNodeCount();
var m = node.getChildNode(10);
print n;
print m;
}