summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--characters.scm11
-rw-r--r--characters/lorenzo.scm6
-rw-r--r--characters/reaper.scm6
-rw-r--r--engine/node-2d.scm28
-rw-r--r--engine/shell.scm8
-rw-r--r--scenes/death.scm10
-rw-r--r--scenes/game.scm45
-rw-r--r--scenes/intro.scm6
-rw-r--r--utils.scm4
9 files changed, 72 insertions, 52 deletions
diff --git a/characters.scm b/characters.scm
index 03789f2..e4f3e53 100644
--- a/characters.scm
+++ b/characters.scm
@@ -1,5 +1,5 @@
;;; The Inevitable Game
-;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2018, 2021 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This program is free software: you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
@@ -18,11 +18,10 @@
(define-module (characters)
#:use-module (chickadee math rect)
#:use-module (chickadee math vector)
- #:use-module (chickadee render color)
- #:use-module (chickadee render font)
- #:use-module (chickadee render shapes)
- #:use-module (chickadee render texture)
- #:use-module (chickadee render tiled)
+ #:use-module (chickadee graphics color)
+ #:use-module (chickadee graphics font)
+ #:use-module (chickadee graphics texture)
+ #:use-module (chickadee graphics tiled)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (ice-9 match)
diff --git a/characters/lorenzo.scm b/characters/lorenzo.scm
index 8c8971f..7615b36 100644
--- a/characters/lorenzo.scm
+++ b/characters/lorenzo.scm
@@ -1,5 +1,5 @@
;;; The Inevitable Game
-;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2018, 2019, 2021 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This program is free software: you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
@@ -16,8 +16,8 @@
;;; <http://www.gnu.org/licenses/>.
(define-module (characters lorenzo)
- #:use-module (chickadee render texture)
- #:use-module (chickadee render color)
+ #:use-module (chickadee graphics texture)
+ #:use-module (chickadee graphics color)
#:use-module (chickadee math rect)
#:use-module (chickadee math vector)
#:use-module (engine assets)
diff --git a/characters/reaper.scm b/characters/reaper.scm
index 1a93ab1..e97d8b2 100644
--- a/characters/reaper.scm
+++ b/characters/reaper.scm
@@ -1,5 +1,5 @@
;;; The Inevitable Game
-;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2018, 2021 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This program is free software: you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
@@ -16,8 +16,8 @@
;;; <http://www.gnu.org/licenses/>.
(define-module (characters reaper)
- #:use-module (chickadee render texture)
- #:use-module (chickadee render color)
+ #:use-module (chickadee graphics texture)
+ #:use-module (chickadee graphics color)
#:use-module (chickadee math rect)
#:use-module (chickadee math vector)
#:use-module (engine assets)
diff --git a/engine/node-2d.scm b/engine/node-2d.scm
index 3de1597..d5919aa 100644
--- a/engine/node-2d.scm
+++ b/engine/node-2d.scm
@@ -1,5 +1,6 @@
;;; Lisp Game Jam 2018
;;; Copyright © 2018 David Thompson <davet@gnu.org>
+;;; Copyright © 2021 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This program is free software: you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
@@ -20,13 +21,13 @@
#:use-module (chickadee math matrix)
#:use-module (chickadee math rect)
#:use-module (chickadee math vector)
- #:use-module (chickadee render)
- #:use-module (chickadee render color)
- #:use-module (chickadee render font)
- #:use-module (chickadee render framebuffer)
- #:use-module (chickadee render shapes)
- #:use-module (chickadee render sprite)
- #:use-module (chickadee render texture)
+ #:use-module (chickadee graphics)
+ #:use-module (chickadee graphics color)
+ #:use-module (chickadee graphics font)
+ #:use-module (chickadee graphics framebuffer)
+ #:use-module (chickadee graphics path)
+ #:use-module (chickadee graphics sprite)
+ #:use-module (chickadee graphics texture)
#:use-module (chickadee scripting)
#:use-module (ice-9 match)
#:use-module (engine assets)
@@ -346,7 +347,18 @@
(color #:accessor color #:init-form black #:init-keyword #:color))
(define-method (draw (r <filled-rect>) alpha)
- (draw-filled-rect (region r) (color r) #:matrix (world-matrix r)))
+ (draw-canvas (make-canvas
+ (with-style
+ ((fill-color (color r)))
+ (fill
+ (rectangle (vec2 (rect-left (region r))
+ (rect-bottom (region r)))
+ (rect-width (region r))
+ (rect-height (region r)))))
+ ;; TODO: wrong type
+ ;#:matrix
+ ;(world-matrix r)
+ )))
;;;
diff --git a/engine/shell.scm b/engine/shell.scm
index 3182483..14ae081 100644
--- a/engine/shell.scm
+++ b/engine/shell.scm
@@ -1,6 +1,6 @@
;;; Lisp Game Jam 2018
+;;; Copyright © 2018, 2021 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 David Thompson <davet@gnu.org>
-;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This program is free software: you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
@@ -21,9 +21,9 @@
#:use-module (chickadee math matrix)
#:use-module (chickadee math rect)
#:use-module (chickadee math vector)
- #:use-module (chickadee render)
- #:use-module (chickadee render framebuffer)
- #:use-module (chickadee render sprite)
+ #:use-module (chickadee graphics)
+ #:use-module (chickadee graphics framebuffer)
+ #:use-module (chickadee graphics sprite)
#:use-module (chickadee scripting)
#:use-module (ice-9 format)
#:use-module (ice-9 match)
diff --git a/scenes/death.scm b/scenes/death.scm
index 0444112..388dae8 100644
--- a/scenes/death.scm
+++ b/scenes/death.scm
@@ -1,5 +1,5 @@
;;; The Inevitable Game
-;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2018, 2021 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This program is free software: you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
@@ -21,10 +21,10 @@
#:use-module (chickadee)
#:use-module (chickadee math rect)
#:use-module (chickadee math vector)
- #:use-module ((chickadee render color) #:select (make-color))
- #:use-module (chickadee render font)
- #:use-module (chickadee render texture)
- #:use-module (chickadee render tiled)
+ #:use-module ((chickadee graphics color) #:select (make-color))
+ #:use-module (chickadee graphics font)
+ #:use-module (chickadee graphics texture)
+ #:use-module (chickadee graphics tiled)
#:use-module (chickadee scripting)
#:use-module (engine assets)
#:use-module (engine audio)
diff --git a/scenes/game.scm b/scenes/game.scm
index 0a7cce9..70bf91a 100644
--- a/scenes/game.scm
+++ b/scenes/game.scm
@@ -1,5 +1,5 @@
;;; The Inevitable Game
-;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2018, 2019, 2021 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018 David Thompson <davet@gnu.org>
;;;
;;; This program is free software: you can redistribute it and/or
@@ -20,11 +20,11 @@
#:use-module (chickadee math easings)
#:use-module (chickadee math rect)
#:use-module (chickadee math vector)
- #:use-module ((chickadee render color) #:hide (color))
- #:use-module (chickadee render font)
- #:use-module (chickadee render shapes)
- #:use-module (chickadee render texture)
- #:use-module (chickadee render tiled)
+ #:use-module (chickadee graphics color)
+ #:use-module (chickadee graphics font)
+ #:use-module ((chickadee graphics path) #:hide (move-to))
+ #:use-module (chickadee graphics texture)
+ #:use-module (chickadee graphics tiled)
#:use-module ((sdl2 input keyboard) #:prefix sdl2:)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
@@ -425,18 +425,27 @@ conversation."
weight
music))
(player (object stats)))
- (for-each (lambda (property index)
- (let* ((value (property player))
- (start (vec2 x (- y (* step index))))
- (end-y (- y (* step index)))
- (end (vec2 (+ x 100) end-y)))
- (draw-line start end
- #:thickness thickness #:color red)
- (when (> value 0)
- (draw-line start (vec2 (+ x value) end-y)
- #:thickness thickness #:color green))))
- properties
- (iota (length properties)))))
+ (let ((painters
+ (map (lambda (property index)
+ (let* ((value (property player))
+ (start (vec2 x (- y (* step index))))
+ (end-y (- y (* step index)))
+ (end (vec2 (+ x 100) end-y)))
+ (with-style
+ ((stroke-color red)
+ (stroke-width thickness))
+ (stroke
+ (line start end)))
+ (when (> value 0)
+ (with-style
+ ((stroke-color green)
+ (stroke-width thickness))
+ (stroke
+ (line start (vec2 (+ x value) end-y)))))))
+ properties
+ (iota (length properties)))))
+ (draw-canvas
+ (make-canvas (apply superimpose painters))))))
(define-method (draw (game <game>) alpha)
(draw-tile-map (asset-ref (tile-map game))
diff --git a/scenes/intro.scm b/scenes/intro.scm
index b1480dc..053cfd8 100644
--- a/scenes/intro.scm
+++ b/scenes/intro.scm
@@ -18,9 +18,9 @@
(define-module (scenes intro)
#:use-module (chickadee math rect)
#:use-module (chickadee math vector)
- #:use-module ((chickadee render color) #:select (make-color))
- #:use-module (chickadee render font)
- #:use-module (chickadee render texture)
+ #:use-module ((chickadee graphics color) #:select (make-color))
+ #:use-module (chickadee graphics font)
+ #:use-module (chickadee graphics texture)
#:use-module (chickadee scripting)
#:use-module (engine assets)
#:use-module (engine audio)
diff --git a/utils.scm b/utils.scm
index d249e86..1e4a7cd 100644
--- a/utils.scm
+++ b/utils.scm
@@ -1,5 +1,5 @@
;;; The Inevitable Game
-;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2018, 2021 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This program is free software: you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
@@ -16,7 +16,7 @@
;;; <http://www.gnu.org/licenses/>.
(define-module (utils)
- #:use-module (chickadee render font)
+ #:use-module (chickadee graphics font)
#:use-module (srfi srfi-1)
#:use-module (ice-9 match)
#:use-module (config)