summaryrefslogtreecommitdiff
path: root/examples/animation.scm
diff options
context:
space:
mode:
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)