diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2019-07-12 23:07:32 +0200 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2019-07-12 23:07:32 +0200 |
commit | c8de1a94ed00d8c6f304c2edb73e3a2419b0ce9b (patch) | |
tree | c7f7db5cd355f9f590af8fbb61e6a4b2db665fab /scenes | |
parent | bc3d81c004e7edfc2ea7449968eaaf44c8806b88 (diff) |
Update to Chickadee 0.4.0.
* characters/lorenzo.scm (default-shader): Remove.
(lorenzo): Use #:tint instead of #:shader; hide shadow when dead.
* engine/node-2d.scm (<sprite>): Replace SHADER field with TINT.
(draw <sprite>): Remove SHADER case.
* engine/node.scm (run-node): Use RUN-GAME instead of RUN-GAME/SDL.
* scenes/death.scm (ghost-shader): Remove.
(populate): Use DEAD? keyword instead of SHADER.
Diffstat (limited to 'scenes')
-rw-r--r-- | scenes/death.scm | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/scenes/death.scm b/scenes/death.scm index 301db14..07e3b8c 100644 --- a/scenes/death.scm +++ b/scenes/death.scm @@ -24,7 +24,6 @@ #:use-module (chickadee render color) #:use-module (chickadee render font) #:use-module (chickadee render texture) - #:use-module (chickadee render shader) #:use-module (chickadee render tiled) #:use-module (chickadee scripting) #:use-module (engine assets) @@ -125,45 +124,6 @@ quite short.")) (set! *random-state* (random-state-from-platform)) -;; This shader renders the texture after blending each pixel with a -;; 0.1 opacity pixel, thereby rendering everything with increased -;; transparency. -(define ghost-shader - (delay - (strings->shader - " -#version 130 - -in vec2 position; -in vec2 tex; -out vec2 frag_tex; -uniform mat4 mvp; - -void main(void) { - frag_tex = tex; - gl_Position = mvp * vec4(position.xy, 0.0, 1.0); -} -" - " -#version 130 - -in vec2 frag_tex; -uniform sampler2D color_texture; - -void main (void) { - vec4 original = texture2D(color_texture, frag_tex); - vec4 g; - - g = vec4(1, 1, 1, 0.1); - g = mix(g, original, 0.5); - gl_FragColor = vec4(original.rgb, min(g.a,original.a)); - if (gl_FragColor.a < 0.5) - { - discard; - } -} -"))) - (define-method (populate (death <death>)) (cons (let* ((text (list-ref texts (random (length texts)))) @@ -191,7 +151,7 @@ void main (void) { #:region (make-rect 0.0 0.0 %width %height) #:color (make-color 0.125 0.09 0.161 0)) (let ((player (lorenzo #:position (vec2 40.0 70.0) - #:shader ghost-shader))) + #:dead? #t))) (set! (visible? player) #f) (set! (walk-speed player) 0.3) player) |