diff options
author | David Thompson <dthompson@vistahigherlearning.com> | 2020-04-17 09:22:22 -0400 |
---|---|---|
committer | David Thompson <dthompson@vistahigherlearning.com> | 2020-04-17 09:22:22 -0400 |
commit | f7d9a89db443c8449c5f64a1ecf92a9b3abb6fdf (patch) | |
tree | 6afc2ad795f67637b44d603adef04e7825ff908d /lisparuga/enemy.scm | |
parent | 5b461c68e3194aef85bd175d51a30f205adb327f (diff) |
Day 7 morning progress.
Diffstat (limited to 'lisparuga/enemy.scm')
-rw-r--r-- | lisparuga/enemy.scm | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lisparuga/enemy.scm b/lisparuga/enemy.scm index 9213890..dd298a6 100644 --- a/lisparuga/enemy.scm +++ b/lisparuga/enemy.scm @@ -98,13 +98,12 @@ (loop (+ i 1))))))) (define-method (on-collision (enemy <enemy>) bullet bullet-polarity hitbox) - ;; TODO: Distinguish between normal play bullets and homing shots - ;; that do more damage. - ;; - ;; Same polarity = 1 point of damage - ;; Opposite polarity = 2 points of damage - (let ((same-polarity? (eq? bullet-polarity (polarity enemy)))) - (damage enemy (if same-polarity? 1 2)) + ;; Same polarity = 1x damage + ;; Opposite polarity = 2x damage + (let* ((same-polarity? (eq? bullet-polarity (polarity enemy))) + (base-damage (if (eq? bullet ikaruga-missile) 10 1)) + (multiplier (if same-polarity? 1 2))) + (damage enemy (* base-damage multiplier)) (when (and same-polarity? (dead? enemy)) (set! (fire-parting-shots? enemy) #t))) #t) |