diff --git a/assets/images/cirkoban-onesheet.png b/assets/images/cirkoban-onesheet.png index 6b1a206..7efd0d1 100644 Binary files a/assets/images/cirkoban-onesheet.png and b/assets/images/cirkoban-onesheet.png differ diff --git a/assets/images/cirkoban.ase b/assets/images/cirkoban.ase index b86fd12..1250dc7 100644 Binary files a/assets/images/cirkoban.ase and b/assets/images/cirkoban.ase differ diff --git a/game.scm b/game.scm index d284eff..86ae3c5 100644 --- a/game.scm +++ b/game.scm @@ -275,6 +275,67 @@ (show-effect! (make-fade-out+in-effect 2.0 k)))) (load-level! 0)))) +(define (emit-pickup-particles x y) + (run-script + (lambda () + (do ((i 0 (1+ i))) + ((= i 24)) + (let ((angle (* (random) 2.0 pi)) + (r (/ tile-width 2.0))) + (particle-pool-add! particles 140 2 + (+ (* x tile-width) + (/ tile-width 2.0) + (* (cos angle) r)) + (+ (* y tile-height) + (/ tile-height 2.0) + (* (sin angle) r)) + 0.0 0.0)) + (wait 1))))) + +(define (emit-electric-switch-particles x y) + (run-script + (lambda () + (do ((i 0 (1+ i))) + ((= i 4)) + (let ((angle (+ (* (random) pi) pi)) + (speed (+ (random) 3.0))) + (particle-pool-add! particles 141 6 + (+ (* x tile-width) + (/ tile-width 2.0)) + (+ (* y tile-height) 3.0) + (* (cos angle) speed) + (* (sin angle) speed))) + (wait 1))))) + +(define (emit-warp-particles x y) + (run-script + (lambda () + (do ((i 0 (1+ i))) + ((= i 4)) + (particle-pool-add! particles 142 6 + (+ (* x tile-width) + (/ tile-width 2.0) + (- (* (random) 6.0) 3.0)) + (+ (* y tile-height) tile-height) + 0.0 + (- (* (random) -2.0) 3.0)) + (wait 2))))) + +(define (emit-explosion-particles x y) + (run-script + (lambda () + (do ((i 0 (1+ i))) + ((= i 16)) + (do ((j 0 (1+ j))) + ((= j 2)) + (let ((dx (- (* (random) tile-width 3.0) tile-width)) + (dy (- (* (random) tile-height 3.0) tile-height))) + (particle-pool-add! particles 51 8 + (+ (* x tile-width) dx) + (+ (* y tile-height) dy) + 0.0 0.0))) + (wait 1))))) + ;; Update loop (define (move-player dir) (define level-complete? #f) @@ -301,7 +362,8 @@ (('player-death x y) (play-sound-effect audio:die)) (('pickup x y) - (play-sound-effect audio:pickup)) + (play-sound-effect audio:pickup) + (emit-pickup-particles x y)) (('emit x y) (play-sound-effect audio:emit)) (('emitter-on x y) @@ -316,28 +378,17 @@ ((or ('floor-switch-on x y) ('floor-switch-off x y)) (play-sound-effect audio:floor-switch)) (('electric-switch-on x y) - (play-sound-effect audio:electric-switch-on)) + (play-sound-effect audio:electric-switch-on) + (emit-electric-switch-particles x y)) (('electric-switch-off x y) (play-sound-effect audio:electric-switch-off)) (('receive-electron x y) - (play-sound-effect audio:warp 0.25)) + (play-sound-effect audio:warp 0.25) + (emit-warp-particles x y)) (('explosion x y) (play-sound-effect audio:explosion) (show-effect! (make-screen-shake-effect 0.2)) - (run-script - (lambda () - (do ((i 0 (1+ i))) - ((= i 16)) - (do ((j 0 (1+ j))) - ((= j 2)) - (let ((angle (* (random) 2.0 pi)) - (dx (- (* (random) tile-width 3.0) tile-width)) - (dy (- (* (random) tile-height 3.0) tile-height))) - (particle-pool-add! particles 51 8 - (+ (* x tile-width) dx) - (+ (* y tile-height) dy) - 0.0 0.0))) - (wait 1))))) + (emit-explosion-particles x y)) (_ (values))) (lp rest)))) (update-objects!) diff --git a/modules/game/actors.scm b/modules/game/actors.scm index 2289a6e..c0b69e1 100644 --- a/modules/game/actors.scm +++ b/modules/game/actors.scm @@ -300,15 +300,15 @@ ($ timer t) (when (= t 0) ($ on? #f) + ($ grid-info 'append-event `(electric-switch-off ,x ,y)) (for-each (lambda (obj) - ($ grid-info 'append-event `(electic-switch-off ,x ,y)) ($ obj 'deactivate grid-info)) (non-player-occupants grid-info target-x target-y)))) (when (>= (electron-head-count neighbor-grid) 1) ($ on? #t) ($ timer 2) + ($ grid-info 'append-event `(electric-switch-on ,x ,y)) (for-each (lambda (obj) - ($ grid-info 'append-event `(electic-switch-on ,x ,y)) ($ obj 'activate grid-info)) (non-player-occupants grid-info target-x target-y))))) (('alive?) #t)