From 128ad5a6bb433a656805c0605aac28b0f6fad758 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Sun, 8 Jul 2018 10:16:23 +0200 Subject: Add a simple player shadow. --- scenes/game.scm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/scenes/game.scm b/scenes/game.scm index cc110f9..1011b2d 100644 --- a/scenes/game.scm +++ b/scenes/game.scm @@ -133,7 +133,22 @@ (define-method (populate (game )) (let ((player (make #:name 'player - #:position (vec2 620.0 1100.0)))) + #:position (vec2 620.0 1100.0) + #:children + ;; Simple player 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 x (- 2 n)) + #:color color)) + ;; position in the stack + (iota 5) + ;; x offsets + (list 12 10 8 10 12) + ;; widths + (list 8 12 16 12 8)))))) (set! %player player) (list player (make -- cgit v1.2.3