get rid of meat table
This commit is contained in:
parent
620caa0ec7
commit
ede6bb6d91
5 changed files with 50 additions and 56 deletions
|
|
@ -15,18 +15,18 @@ end
|
|||
|
||||
function Cursor:update(dt)
|
||||
self.x, self.y = love.mouse.getPosition()
|
||||
local isAboveMeatTable = false
|
||||
local isAboveMeatFactory = false
|
||||
|
||||
-- Check if cursor is above any meat table
|
||||
for _, meatTable in ipairs(instances.meat_tables) do
|
||||
if meatTable:isHovering(self.x, self.y) then
|
||||
isAboveMeatTable = true
|
||||
-- Check if cursor is above any meat factory
|
||||
for _, meatFactory in ipairs(instances.meat_factories) do
|
||||
if meatFactory:isHovering(self.x, self.y) then
|
||||
isAboveMeatFactory = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
-- Update the cleaver state or cursor state accordingly
|
||||
if isAboveMeatTable then
|
||||
if isAboveMeatFactory then
|
||||
self.state = "cleaver"
|
||||
else
|
||||
self.state = "idle"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue