diff options
author | David Thompson <dthompson2@worcester.edu> | 2017-01-23 21:36:29 -0500 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2017-01-23 21:36:29 -0500 |
commit | e0d1e5e336ed814d94649571a7ff0ae442153cf2 (patch) | |
tree | 3e1201f38d7ea78f4e02f16522afb433ee42da5b /examples | |
parent | 4c97169572d55c5eb940817024335588d08c8d1d (diff) |
Add basic sprite example.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/images/chickadee.png | bin | 0 -> 755 bytes | |||
-rw-r--r-- | examples/sprite.scm | 17 |
2 files changed, 17 insertions, 0 deletions
diff --git a/examples/images/chickadee.png b/examples/images/chickadee.png Binary files differnew file mode 100644 index 0000000..17a35e0 --- /dev/null +++ b/examples/images/chickadee.png 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) |