summaryrefslogtreecommitdiff
path: root/starling/node-2d.scm
diff options
context:
space:
mode:
Diffstat (limited to 'starling/node-2d.scm')
-rw-r--r--starling/node-2d.scm6
1 files changed, 4 insertions, 2 deletions
diff --git a/starling/node-2d.scm b/starling/node-2d.scm
index 6d83da2..f7a40df 100644
--- a/starling/node-2d.scm
+++ b/starling/node-2d.scm
@@ -39,6 +39,7 @@
#:use-module (chickadee scripting)
#:use-module (ice-9 match)
#:use-module (oop goops)
+ #:use-module (rnrs base)
#:use-module (starling asset)
#:use-module (starling node)
#:use-module (starling scene)
@@ -499,8 +500,9 @@
(frame-duration (frame-duration anim))
(frames (frames anim))
(anim-duration (* frame-duration (vector-length frames)))
- (time (modulo (- (elapsed-time) (start-time sprite)) anim-duration))
- (frame (vector-ref frames (floor (/ time frame-duration)))))
+ (time (mod (- (elapsed-time) (start-time sprite)) anim-duration))
+ (frame (vector-ref frames (inexact->exact
+ (floor (/ time frame-duration))))))
(set! (index sprite) frame)
(next-method)))