From 7cf9c498d7e6f0a41b6ce252f4b8247222cdfb18 Mon Sep 17 00:00:00 2001 From: annabunches Date: Thu, 28 Sep 2023 16:53:26 -0400 Subject: [PATCH] Add second failure mode. --- src/main.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.lua b/src/main.lua index d4a971b..77bf8c8 100644 --- a/src/main.lua +++ b/src/main.lua @@ -137,6 +137,12 @@ end function movePaddle(ticks) if ticks == 0 then return end paddle:moveWithCollisions(paddle.x, paddle.y + ticks*-5) + for i = 1, #collisions, 1 do + local obj = collisions[i].other + if obj:isa(Brick) then + endGame() + end + end end function moveBall()