diff options
author | David Thompson <dthompson@vistahigherlearning.com> | 2021-10-23 17:09:34 -0400 |
---|---|---|
committer | David Thompson <dthompson@vistahigherlearning.com> | 2021-10-23 17:09:34 -0400 |
commit | 3fc18437f905f18aa4bf3b688930dbc68f8721b3 (patch) | |
tree | e14a25532309c88e2a33d5a7641f381a69733966 /bonnie-bee/boss.scm | |
parent | fb31282c18f33acb6de24e604059df6d05477491 (diff) |
Lots of tweaks and also sprite animations!
Diffstat (limited to 'bonnie-bee/boss.scm')
-rw-r--r-- | bonnie-bee/boss.scm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bonnie-bee/boss.scm b/bonnie-bee/boss.scm index 885f0bc..e312d4e 100644 --- a/bonnie-bee/boss.scm +++ b/bonnie-bee/boss.scm @@ -21,9 +21,12 @@ (define-method (on-boot (boss <boss>)) (attach-to boss - (make <sprite> - #:texture beetle-image - #:origin (vec2 64.0 32.0)))) + (make <animated-sprite> + #:atlas beetle-atlas + #:origin (vec2 64.0 32.0) + #:animations `((default . ,(make <animation> + #:frames #(0 1) + #:frame-duration 0.4)))))) (define-method (on-enter (boss <boss>)) (define (circle-shot n offset speed type) @@ -51,13 +54,13 @@ (little-speed 1.0)) (while (> (health boss) 800) (let ((d (direction-to boss (player (parent boss))))) + (audio-play (asset-ref enemy-shoot-sound)) (add-bullet (bullets (parent boss)) large-enemy-bullet (position boss) (vec2* d big-speed)) (let loop ((i 0)) (when (< i 16) - (audio-play (asset-ref enemy-shoot-sound)) (random-shot little-speed) (sleep (* (current-timestep) 2.0)) (loop (+ i 1))))))) |