(define-module (bonnie-bee popcorn) #:use-module (bonnie-bee actor) #:use-module (bonnie-bee assets) #:use-module (bonnie-bee bullet) #:use-module (chickadee audio) #:use-module (chickadee graphics particles) #:use-module (chickadee math) #:use-module (chickadee math rect) #:use-module (chickadee math vector) #:use-module (chickadee scripting) #:use-module (chickadee utils) #:use-module (oop goops) #:use-module (catbird asset) #:use-module (catbird node) #:use-module (catbird node-2d) #:export ()) (define-class ( )) (define-method (on-boot (popcorn )) (attach-to popcorn (make #:atlas popcorn-atlas #:origin (vec2 16.0 16.0) #:animations `((default . ,(make #:frames #(0 1) #:frame-duration .25)))))) (define-method (on-collide (popcorn ) (bullet )) (if (player-bullet? bullet) (begin (damage popcorn 1) (kill-bullet bullet) #t) #f)) (define-method (on-death (popcorn )) (audio-play (artifact explosion-sound)) (let ((p (position popcorn))) (add-particle-emitter (particles (& (parent popcorn) particles)) (make-particle-emitter (make-rect (vec2-x p) (vec2-y p) 1.0 1.0) 4 3))))