summaryrefslogtreecommitdiff
path: root/scenes
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2018-11-12 18:00:28 +0100
committerRicardo Wurmus <rekado@elephly.net>2018-11-12 18:00:28 +0100
commit4116f2ccf02cda8c3a083a62aa91e4e3956dfb73 (patch)
tree55e31b4d23c657f06304697ce439189ee0e973ef /scenes
parentd991fd8e63bbf90d2ee9efb688ab8cd76d2a0f9f (diff)
game: Use "and" instead of weird "if".
Diffstat (limited to 'scenes')
-rw-r--r--scenes/game.scm15
1 files changed, 7 insertions, 8 deletions
diff --git a/scenes/game.scm b/scenes/game.scm
index f49a17a..f896cd8 100644
--- a/scenes/game.scm
+++ b/scenes/game.scm
@@ -122,14 +122,13 @@ positions layer."
(- (rect-y r-wrong) (rect-height r-wrong))
(rect-width r-wrong)
(rect-height r-wrong))))
- (if (rect-intersects? hitbox r)
- (begin
- (set-rect-x! hit-vis (+ (rect-x r) (vec2-x offset)))
- (set-rect-y! hit-vis (+ (rect-y r) (vec2-y offset)))
- (set-rect-width! hit-vis (rect-width r))
- (set-rect-height! hit-vis (rect-height r))
- obj)
- #f)))
+ (and (rect-intersects? hitbox r)
+ (begin
+ (set-rect-x! hit-vis (+ (rect-x r) (vec2-x offset)))
+ (set-rect-y! hit-vis (+ (rect-y r) (vec2-y offset)))
+ (set-rect-width! hit-vis (rect-width r))
+ (set-rect-height! hit-vis (rect-height r))
+ obj))))
(object-layer-objects
(tile-map-layer-ref (asset-ref (tile-map game)) layer)))))