From 6537f308d21377f52598034d73575d464b2fac3b Mon Sep 17 00:00:00 2001 From: Ratstail91 Date: Wed, 8 Mar 2023 08:01:40 +1100 Subject: [PATCH] Tweaked timing --- assets/scripts/gameplay/lejana.toy | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/assets/scripts/gameplay/lejana.toy b/assets/scripts/gameplay/lejana.toy index b364696..c4b73d5 100644 --- a/assets/scripts/gameplay/lejana.toy +++ b/assets/scripts/gameplay/lejana.toy @@ -149,6 +149,19 @@ fn onStep(node: opaque) { } } + //actually animate + if (++stepCount >= 5) { + if (motionX == 0 && motionY == 0 && inputX == 0 && inputY == 0) { + stepCount = 0; + } + + if (attackCounter > 0) { + attackCounter--; + } + + node.incrementCurrentNodeFrame(); + } + //animation - standing still if (attackCounter == 0 && stepCount == 0) { //move to standing state @@ -164,20 +177,8 @@ fn onStep(node: opaque) { if (node.getNodeRectY() != 32) { node.setNodeRect(direction * 32 * 4, 32, 32, 32); node.setNodeFrames(3); - } - } - - //actually animate - if (++stepCount >= 5) { - if (motionX == 0 && motionY == 0 && inputX == 0 && inputY == 0) { stepCount = 0; } - - if (attackCounter > 0) { - attackCounter--; - } - - node.incrementCurrentNodeFrame(); } //calc movement @@ -209,7 +210,7 @@ fn onKeyDown(node: opaque, event: string) { } if (event == "character_attack" && inputX == 0 && inputY == 0) { - attackCounter = 2; + attackCounter = 3; return; }