From e0d1e5e336ed814d94649571a7ff0ae442153cf2 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Mon, 23 Jan 2017 21:36:29 -0500 Subject: Add basic sprite example. --- examples/images/chickadee.png | Bin 0 -> 755 bytes examples/sprite.scm | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 examples/images/chickadee.png create mode 100644 examples/sprite.scm diff --git a/examples/images/chickadee.png b/examples/images/chickadee.png new file mode 100644 index 0000000..17a35e0 Binary files /dev/null and b/examples/images/chickadee.png 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) -- cgit v1.2.3