Replaced polyfills with real implementations
This commit is contained in:
@@ -23,7 +23,7 @@ var stepAI: int = 0;
|
||||
var health: int = 2;
|
||||
var requestFree: bool = false;
|
||||
|
||||
//polyfills - animating different cycles on one image
|
||||
//animating different cycles on one image
|
||||
var walkAnimationCounter: int = 0;
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ fn isRequestingFree(node: opaque) {
|
||||
if (requestFree) {
|
||||
var parent = node.getParentNode();
|
||||
|
||||
var explosion: opaque = parent.loadChild("scripts:/entities/explosion.toy");
|
||||
var explosion: opaque = parent.loadChildNode("scripts:/entities/explosion.toy");
|
||||
explosion.callNodeFn("setGridPosition", gridPositionX, gridPositionY);
|
||||
return true;
|
||||
}
|
||||
@@ -161,22 +161,3 @@ fn faceDirection(node: opaque, dir: int) {
|
||||
node.setNodeFrames(2);
|
||||
walkAnimationCounter = 12;
|
||||
}
|
||||
|
||||
|
||||
//polyfills - move these to standard
|
||||
fn normalize(x): int {
|
||||
if (x > 0) {
|
||||
return 1;
|
||||
}
|
||||
if (x < 0) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
fn loadChild(parent: opaque, fname: string) {
|
||||
//TODO: add this to the API proper
|
||||
var child: opaque = loadNode(fname);
|
||||
parent.pushNode(child);
|
||||
return child;
|
||||
}
|
||||
Reference in New Issue
Block a user