summaryrefslogtreecommitdiff
path: root/examples/animation.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson@member.fsf.org>2013-08-27 18:22:06 -0400
committerDavid Thompson <dthompson@member.fsf.org>2013-08-27 18:22:06 -0400
commit5841889f53465b4096830f3778b209063e1fe8bc (patch)
tree724087d4dbfeb08349401d7ff19e0f099a550667 /examples/animation.scm
parente719d1e988617f623fac29c1bd347785833c5f71 (diff)
Replace old vector module with new vector2 module.
Diffstat (limited to 'examples/animation.scm')
-rw-r--r--examples/animation.scm26
1 files changed, 13 insertions, 13 deletions
diff --git a/examples/animation.scm b/examples/animation.scm
index d00a9df..0e58b8e 100644
--- a/examples/animation.scm
+++ b/examples/animation.scm
@@ -2,8 +2,8 @@
(2d game-loop)
(2d helpers)
(2d sprite)
- (2d texture)
- (2d vector)
+ (2d tileset)
+ (2d vector2)
(2d window))
(define window-width 800)
@@ -28,21 +28,21 @@
;; Load a texture, split it into 64x64 tiles, and build an animated
;; sprite out of it.
(define animation
- (let* ((tiles (split-texture (load-texture "images/princess.png") 64 64))
- (frames (vector (vector-ref tiles 19)
- (vector-ref tiles 20)
- (vector-ref tiles 21)
- (vector-ref tiles 22)
- (vector-ref tiles 23)
- (vector-ref tiles 24)
- (vector-ref tiles 25)
- (vector-ref tiles 26))))
+ (let* ((tiles (load-tileset "images/princess.png" 64 64))
+ (frames (vector (tileset-ref tiles 19)
+ (tileset-ref tiles 20)
+ (tileset-ref tiles 21)
+ (tileset-ref tiles 22)
+ (tileset-ref tiles 23)
+ (tileset-ref tiles 24)
+ (tileset-ref tiles 25)
+ (tileset-ref tiles 26))))
(make-animation frames 6 #t)))
(define sprite
(make-sprite animation
- #:position (vector (/ window-width 2)
- (/ window-height 2))))
+ #:position (vector2 (/ window-width 2)
+ (/ window-height 2))))
(run-game-loop)