From 8287a51f6ea8e11e20d75382835b5368cf75c62c Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 15 Jul 2018 22:00:11 +0200 Subject: Add reaper character. --- assets/images/README | 9 +++++++++ assets/images/reaper.png | Bin 0 -> 15555 bytes assets/images/src/reaper.xcf | Bin 0 -> 27394 bytes scenes/game.scm | 38 +++++++++++++++++++++++++++++++++++++- 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 assets/images/reaper.png create mode 100644 assets/images/src/reaper.xcf diff --git a/assets/images/README b/assets/images/README index ab6f672..5ca70ce 100644 --- a/assets/images/README +++ b/assets/images/README @@ -4,3 +4,12 @@ License: CC-BY-SA 3.0 Based on "https://opengameart.org/content/small-34-rpg-character-base" under CC-BY 3.0 / CC-BY-SA 3.0 / OGA-BY 3.0 + +* reaper.png + src/reaper.xcf + +Author: Ricardo Wurmus +License: CC-BY 3.0 + +Based on "Lil Reaper Pet" by Tracy (https://opengameart.org/users/tracy). +https://opengameart.org/content/lil-grim-pet-or-npc +Original License: CC-BY 3.0 diff --git a/assets/images/reaper.png b/assets/images/reaper.png new file mode 100644 index 0000000..9b72719 Binary files /dev/null and b/assets/images/reaper.png differ diff --git a/assets/images/src/reaper.xcf b/assets/images/src/reaper.xcf new file mode 100644 index 0000000..13a6022 Binary files /dev/null and b/assets/images/src/reaper.xcf differ diff --git a/scenes/game.scm b/scenes/game.scm index 4e6be37..6ebbaab 100644 --- a/scenes/game.scm +++ b/scenes/game.scm @@ -111,6 +111,24 @@ #:current-animation 'idle-front #:frame-duration 10))) + +(define-class () + (talking #:accessor talking #:init-form #f)) + +(define-asset reaper-atlas + (load-atlas "assets/images/reaper.png" 32 32)) + +(define-method (populate (reaper )) + (list + (make + #:name 'sprite + #:atlas reaper-atlas + #:animations '((idle . #(0 0 0 1 1 1 9 1 1 1 8 8 8 8 8 8 5 4 4 4 0 0 0 3 3)) + (pause . #(4 4 4 4 4 4 4 5)) + (talk . #(0 3 2 7 5 4 6 5 3 2 2 2 4 4 0 0 0))) + #:current-animation 'idle + #:frame-duration 20))) + (define-asset test-map (load-tile-map "assets/maps/01.tmx")) @@ -150,12 +168,30 @@ ;; widths (list 8 12 16 12 8)))))) (set! %player player) - (list player + (list (make + #:name 'reaper + #:position (vec2 720.0 1100.0) + #:children + ;; Simple shadow. This should better be done with a + ;; single ellipse shader. + (let ((color (make-color 0 0 0 0.2))) + (map (lambda (n x w) + (make + #:region (make-rect 0.0 0.0 w 1.0) + #:position (vec2 (+ 3 x) (- 2 n)) + #:color color)) + ;; position in the stack + (iota 5) + ;; x offsets + (list 12 10 8 10 12) + ;; widths + (list 12 16 20 16 12)))) (make #:name 'hit #:region (make-rect 0.0 0.0 0.0 0.0) #:position (vec2 0 0) #:color (transparency 0.2)) + player (make #:name 'top-layer #:position (vec2 0.0 0.0)) -- cgit v1.2.3