From a610d4f3c513107135ece5276afffa4223c7ee4b Mon Sep 17 00:00:00 2001 From: "Jakob L. Kreuze" Date: Fri, 26 Oct 2018 14:13:54 -0400 Subject: Rest of greetz and maps. Game is essentially complete --- world.fnl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'world.fnl') diff --git a/world.fnl b/world.fnl index 152fa62..947b7bc 100644 --- a/world.fnl +++ b/world.fnl @@ -107,9 +107,9 @@ (fn draw-world [world camera-x camera-y screen-width screen-height] (love.graphics.clear 0.1 0.1 0.1) (draw-map world camera-x camera-y screen-width screen-height) - (draw-object (. world :player) camera-x camera-y) (each [_ slimeball (ipairs (. world :slimeballs))] (draw-object slimeball camera-x camera-y)) + (draw-object (. world :player) camera-x camera-y) (draw-hud world screen-width screen-height)) ;; Returns whether or not `tile' exists in `checked'. @@ -264,7 +264,7 @@ (fn move-slimeball [world slimeball dt] (let [collision-map (. world :collision-map) (goal-x goal-y) (: slimeball :next-position dt) - filter (fn [] "cross") + filter (fn [_ other] (if (. other :is-tile) "touch" "cross")) (x y collisions _) (: collision-map :move slimeball goal-x goal-y filter)] (each [_ collision (ipairs collisions)] (let [other (. collision :other) -- cgit v1.3