summaryrefslogtreecommitdiff
path: root/animise.lisp
diff options
context:
space:
mode:
authorBoutade <thegoofist@protonmail.com>2019-10-18 12:08:52 -0500
committerBoutade <thegoofist@protonmail.com>2019-10-18 12:08:52 -0500
commitaeb013df855052aec8a5199f82d9725be6d99c1b (patch)
tree58da893961d92ae9db129566b192ae7936271d0a /animise.lisp
parent23284accc56c71f3e293fc9ac0c923988ce4ab6a (diff)
checking for completes in a sequence
Diffstat (limited to 'animise.lisp')
-rw-r--r--animise.lisp9
1 files changed, 8 insertions, 1 deletions
diff --git a/animise.lisp b/animise.lisp
index 232a6c1..4cb54ac 100644
--- a/animise.lisp
+++ b/animise.lisp
@@ -248,12 +248,19 @@
;; (reverse-tween seq)
;; (car (tweens seq)))))))
+(defun has-on-complete (thing)
+ (and (typep thing 'tween)
+ (on-complete thing)))
(defmethod run-tween ((ob tween-seq) time)
(let-when (tween (or
;; find the first unfinished tween in the sequence
(find-if-not (lambda (tween)
- (tween-finished-p tween time))
+ (when (tween-finished-p tween time)
+ (when (has-on-complete tween)
+ (funcall (on-complete tween))
+ (setf (on-complete tween) nil))
+ t))
(tweens ob))
;; otherwise apply any looping configuration on the sequence
;; and apply the tween that results