summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2018-07-15 22:00:11 +0200
committerRicardo Wurmus <rekado@elephly.net>2018-07-27 17:15:44 +0200
commit8287a51f6ea8e11e20d75382835b5368cf75c62c (patch)
treef8dff5e9f48461882e147b30e9eefac159b9daec
parentf260cc40384793e5d0ef4be741060eec72fc57f5 (diff)
Add reaper character.
-rw-r--r--assets/images/README9
-rw-r--r--assets/images/reaper.pngbin0 -> 15555 bytes
-rw-r--r--assets/images/src/reaper.xcfbin0 -> 27394 bytes
-rw-r--r--scenes/game.scm38
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
new file mode 100644
index 0000000..9b72719
--- /dev/null
+++ b/assets/images/reaper.png
Binary files differ
diff --git a/assets/images/src/reaper.xcf b/assets/images/src/reaper.xcf
new file mode 100644
index 0000000..13a6022
--- /dev/null
+++ b/assets/images/src/reaper.xcf
Binary files differ
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))