meat tables + factory creation
This commit is contained in:
parent
e52e10c0c8
commit
eb1a82d1f3
12 changed files with 161 additions and 16 deletions
26
meat_tables.lua
Normal file
26
meat_tables.lua
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
MeatTable = {}
|
||||
MeatTable.__index = MeatTable
|
||||
|
||||
function MeatTable:new()
|
||||
local instance = setmetatable({}, MeatTable)
|
||||
instance.image = love.graphics.newImage("assets/images/env/newer_table.png")
|
||||
instance.x = (love.graphics.getWidth() - instance.image:getWidth()) / 2;
|
||||
instance.y = (love.graphics.getHeight() - instance.image:getHeight()) / 2;
|
||||
return instance
|
||||
end
|
||||
|
||||
function MeatTable:draw()
|
||||
local x = self.x
|
||||
local image = self.image
|
||||
local y = self.y
|
||||
love.graphics.draw(image, x, y);
|
||||
end
|
||||
|
||||
function MeatTable:isHovering(x, y)
|
||||
return x >= self.x and x <= self.x + self.image:getWidth() and y >= self.y and y <= self.y + self.image:getHeight()
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
return MeatTable
|
||||
Loading…
Add table
Add a link
Reference in a new issue