43 lines
764 B
Lua
43 lines
764 B
Lua
|
|
require "entity"
|
||
|
|
|
||
|
|
GenericSticky = class("GenericSticky", Entity)
|
||
|
|
|
||
|
|
function GenericSticky:initialize(x, y, color, sprite, name, cellShape)
|
||
|
|
Entity.initialize(self, {
|
||
|
|
name = name,
|
||
|
|
x = x,
|
||
|
|
y = y,
|
||
|
|
color = color,
|
||
|
|
collision = "moveable",
|
||
|
|
sticky = true,
|
||
|
|
sprite = sprite,
|
||
|
|
cellShape = cellShape
|
||
|
|
})
|
||
|
|
end
|
||
|
|
|
||
|
|
function GenericSticky:update()
|
||
|
|
|
||
|
|
end
|
||
|
|
|
||
|
|
function GenericSticky:draw(channel)
|
||
|
|
local sprite = self.sprites[channel]
|
||
|
|
if not sprite then return end
|
||
|
|
if not drawGoopySprite then
|
||
|
|
Entity.draw(self, channel)
|
||
|
|
return
|
||
|
|
end
|
||
|
|
|
||
|
|
love.graphics.setColor(gColor[channel]:set())
|
||
|
|
local p = self:getDrawPos()
|
||
|
|
drawGoopySprite(
|
||
|
|
sprite,
|
||
|
|
p.x + self.drawOffset.x * drawScale,
|
||
|
|
p.y + self.drawOffset.y * drawScale,
|
||
|
|
drawScale
|
||
|
|
)
|
||
|
|
end
|
||
|
|
|
||
|
|
function GenericSticky:tick()
|
||
|
|
|
||
|
|
end
|