From 8a647c06f8734218eedbbd4e2e79c9ec6e2bae9f Mon Sep 17 00:00:00 2001 From: Andy Arminio Date: Wed, 25 Oct 2023 22:29:48 -0600 Subject: [PATCH 1/2] Fix for if-let behavior --- junk-drawer/tweens.janet | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/junk-drawer/tweens.janet b/junk-drawer/tweens.janet index e3e70a6..174e4fe 100644 --- a/junk-drawer/tweens.janet +++ b/junk-drawer/tweens.janet @@ -176,7 +176,7 @@ examples/07-tweens.janet for more! :table (merge (current key) val)))) # Tick the tweens elapsed time, delete it if we've reached its duration - (if-let [new-elapsed (+ elapsed 1) - complete? (> new-elapsed duration)] - (remove-entity wld tween-ent) - (put tween-data :elapsed-time new-elapsed)))) + (let [new-elapsed (+ elapsed 1)] + (if (> elapsed duration) + (remove-entity wld tween-ent) + (put tween-data :elapsed-time new-elapsed))))) From adffa0afae8b12ae83b894bfd79e2d3c8da7b22d Mon Sep 17 00:00:00 2001 From: Andy Arminio <5thWall@gmail.com> Date: Sun, 19 Nov 2023 15:28:47 -0700 Subject: [PATCH 2/2] Update junk-drawer/tweens.janet Co-authored-by: Alec Troemel --- junk-drawer/tweens.janet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/junk-drawer/tweens.janet b/junk-drawer/tweens.janet index 174e4fe..5253120 100644 --- a/junk-drawer/tweens.janet +++ b/junk-drawer/tweens.janet @@ -177,6 +177,6 @@ examples/07-tweens.janet for more! # Tick the tweens elapsed time, delete it if we've reached its duration (let [new-elapsed (+ elapsed 1)] - (if (> elapsed duration) + (if (>= elapsed duration) (remove-entity wld tween-ent) (put tween-data :elapsed-time new-elapsed)))))