summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2017-01-23 21:36:29 -0500
committerDavid Thompson <dthompson2@worcester.edu>2017-01-23 21:36:29 -0500
commite0d1e5e336ed814d94649571a7ff0ae442153cf2 (patch)
tree3e1201f38d7ea78f4e02f16522afb433ee42da5b
parent4c97169572d55c5eb940817024335588d08c8d1d (diff)
Add basic sprite example.
-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)