From 409800a54fefe733ca962c0abc60f7d3e33473ea Mon Sep 17 00:00:00 2001 From: Juan Date: Thu, 7 Aug 2025 12:26:28 -0400 Subject: [PATCH] removing unnecssary score pending --- cleaver.lua | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cleaver.lua b/cleaver.lua index 0ca5333..2857be2 100644 --- a/cleaver.lua +++ b/cleaver.lua @@ -7,7 +7,6 @@ function Cleaver:new() instance.images = {} instance.state = "idle" instance.timer = 0 - instance.scorePending = false instance.score = 0 return instance end @@ -35,10 +34,6 @@ function Cleaver:update(dt) self.state = "idle" self.currentImage = self.images.idle self.timer = 0 - if self.scorePending then - self.score = self.score + 1 - self.scorePending = false - end end end end @@ -57,7 +52,6 @@ function Cleaver:mousepressed(button) self.state = "windup" self.currentImage = self.images.windup self.timer = 0 - self.scorePending = false end end @@ -67,13 +61,13 @@ function Cleaver:mousereleased(button) self.state = "chop" self.currentImage = self.images.chop self.timer = 0 - self.scorePending = true -- Check if the cleaver is hovering over a meat instance local x, y = love.mouse.getPosition() for i, meat in ipairs(instances.meats) do if x >= meat.x and x <= meat.x + meat.currentImage:getWidth() and y >= meat.y and y <= meat.y + meat.currentImage:getHeight() then -- Remove the meat instance from the table table.remove(instances.meats, i) + self.score = self.score + 1 break end end