diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2018-07-15 22:00:11 +0200 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2018-07-27 17:15:44 +0200 |
commit | 8287a51f6ea8e11e20d75382835b5368cf75c62c (patch) | |
tree | f8dff5e9f48461882e147b30e9eefac159b9daec | |
parent | f260cc40384793e5d0ef4be741060eec72fc57f5 (diff) |
Add reaper character.
-rw-r--r-- | assets/images/README | 9 | ||||
-rw-r--r-- | assets/images/reaper.png | bin | 0 -> 15555 bytes | |||
-rw-r--r-- | assets/images/src/reaper.xcf | bin | 0 -> 27394 bytes | |||
-rw-r--r-- | scenes/game.scm | 38 |
4 files changed, 46 insertions, 1 deletions
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 Binary files differnew file mode 100644 index 0000000..9b72719 --- /dev/null +++ b/assets/images/reaper.png diff --git a/assets/images/src/reaper.xcf b/assets/images/src/reaper.xcf Binary files differnew file mode 100644 index 0000000..13a6022 --- /dev/null +++ b/assets/images/src/reaper.xcf diff --git a/scenes/game.scm b/scenes/game.scm index 4e6be37..6ebbaab 100644 --- a/scenes/game.scm +++ b/scenes/game.scm @@ -112,6 +112,24 @@ #:frame-duration 10))) +(define-class <reaper> (<character>) + (talking #:accessor talking #:init-form #f)) + +(define-asset reaper-atlas + (load-atlas "assets/images/reaper.png" 32 32)) + +(define-method (populate (reaper <reaper>)) + (list + (make <animated-sprite> + #: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")) (define-class <game> (<scene>) @@ -150,12 +168,30 @@ ;; widths (list 8 12 16 12 8)))))) (set! %player player) - (list player + (list (make <reaper> + #: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 <filled-rect> + #: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 <filled-rect> #:name 'hit #:region (make-rect 0.0 0.0 0.0 0.0) #:position (vec2 0 0) #:color (transparency 0.2)) + player (make <top-layer> #:name 'top-layer #:position (vec2 0.0 0.0)) |