summaryrefslogtreecommitdiff
path: root/examples/sprite.scm
diff options
context:
space:
mode:
Diffstat (limited to 'examples/sprite.scm')
-rw-r--r--examples/sprite.scm17
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/sprite.scm b/examples/sprite.scm
new file mode 100644
index 0000000..86a2788
--- /dev/null
+++ b/examples/sprite.scm
@@ -0,0 +1,17 @@
+(use-modules (chickadee)
+ (chickadee math vector)
+ (chickadee render sprite)
+ (chickadee render texture))
+
+(define sprite #f)
+
+(define (load)
+ (set! sprite (load-image "images/chickadee.png")))
+
+(define (draw alpha)
+ (draw-sprite sprite (vec2 256.0 176.0)))
+
+(add-hook! load-hook load)
+(add-hook! draw-hook draw)
+
+(run-game)