summaryrefslogtreecommitdiff
path: root/scenes
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-02-25 23:57:06 +0100
committerRicardo Wurmus <rekado@elephly.net>2021-02-25 23:57:06 +0100
commit7bd387d35baea9f6861c81f4286f68999849ea63 (patch)
treeb5f6d9123753c0cfb546bc1a0baee15eb1ecc198 /scenes
parent9ecdd2b37166625e99a76844f7ff0b27c2ff3022 (diff)
Move from (chickadee render ...) to (chickadee graphics ...).
The only notable changes are listed below: * engine/node-2d.scm (draw)<filled-rect>: Use new API from (chickadee graphics path). * scenes/game.scm (draw)<stats>: Same.
Diffstat (limited to 'scenes')
-rw-r--r--scenes/death.scm10
-rw-r--r--scenes/game.scm45
-rw-r--r--scenes/intro.scm6
3 files changed, 35 insertions, 26 deletions
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)