summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/images/chickadee.pngbin0 -> 755 bytes
-rw-r--r--examples/sprite.scm17
2 files changed, 17 insertions, 0 deletions
diff --git a/examples/images/chickadee.png b/examples/images/chickadee.png
new file mode 100644
index 0000000..17a35e0
--- /dev/null
+++ b/examples/images/chickadee.png
Binary files differ
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)