Add directional sticky and skewer box variants
This commit is contained in:
parent
c3f5aafd77
commit
f549eaf523
13 changed files with 723 additions and 101 deletions
42
generic_sticky.lua
Normal file
42
generic_sticky.lua
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue