diff options
-rw-r--r-- | game.scm | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -696,7 +696,18 @@ (let ((x* (- x (/ w 2.0))) (y* (- y(/ h 2.0)))) (or (out-of-bounds? x* y* w h) - (rect-collides-with-level? level x* y* w h)))) + (rect-collides-with-level? level x* y* w h) + (if (rect-within? x y w h + (- (vec2-x player-position) + (/ player-hitbox-width 2.0)) + (- (vec2-y player-position) + (/ player-hitbox-height 2.0)) + player-hitbox-width + player-hitbox-height) + (begin + (player-die!) + #t) + #f)))) (define (enemy-collide x y w h hp) hp) |