From b1f6fa21e8b1ab5ffd2d3cceabb91b9e5dd8226a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 18 Sep 2020 09:37:46 +0200 Subject: Initial commit --- heyllama.scm | 35 +++++++++++++++++++++++++++++++++++ llama_eat.png | Bin 0 -> 11051 bytes llama_walk.png | Bin 0 -> 11280 bytes sheep_walk.png | Bin 0 -> 8222 bytes 4 files changed, 35 insertions(+) create mode 100644 heyllama.scm create mode 100644 llama_eat.png create mode 100644 llama_walk.png create mode 100644 sheep_walk.png diff --git a/heyllama.scm b/heyllama.scm new file mode 100644 index 0000000..1288326 --- /dev/null +++ b/heyllama.scm @@ -0,0 +1,35 @@ +(use-modules (chickadee) + (chickadee math vector) + (chickadee render font) + (chickadee render sprite) + (chickadee render texture)) + + +(define pos #v(100.0 140.0)) +(define sprite #f) +(define ss 0) +(define time 0) + +(define (draw alpha) + (draw-sprite (texture-atlas-ref sprite (+ 12 ss)) + pos)) + +(define (update t) + (set! time (+ time 1)) + (set! pos (vec2+ pos #v(1.0 0.0))) + (when (eq? (floor-remainder time 4) 0) + (set! ss (floor-remainder (+ ss 1) 4)))) + + +(define (load) + (set! sprite (split-texture (load-image "llama_walk.png") + 128 128))) + +(define (key-press key scancode modifier repea?) + (when (eq? key 'q) + (abort-game))) + +(run-game #:load load + #:draw draw + #:key-press key-press + #:update update) diff --git a/llama_eat.png b/llama_eat.png new file mode 100644 index 0000000..8852c93 Binary files /dev/null and b/llama_eat.png differ diff --git a/llama_walk.png b/llama_walk.png new file mode 100644 index 0000000..00cc39d Binary files /dev/null and b/llama_walk.png differ diff --git a/sheep_walk.png b/sheep_walk.png new file mode 100644 index 0000000..9696e10 Binary files /dev/null and b/sheep_walk.png differ -- cgit v1.2.3