automatically gets bouif pull = true then
This commit is contained in:
parent
747a7b7b58
commit
214758388e
14 changed files with 143 additions and 81 deletions
8
door.lua
8
door.lua
|
|
@ -8,7 +8,7 @@ function Door:initialize(x, y, colors)
|
|||
y = y,
|
||||
color = "white",
|
||||
collision = "unmoveable",
|
||||
sprite = doorSprite["white"] --doesn't matter for now which we put here b/c, we override the draw function neway
|
||||
sprite = sprites.door["green"] --doesn't matter for now which we put here b/c, we override the draw function neway
|
||||
})
|
||||
self.locked = true
|
||||
|
||||
|
|
@ -24,17 +24,17 @@ function Door:draw()
|
|||
if active then
|
||||
love.graphics.setColor(gColor[color]:set())
|
||||
local p = self:getDrawPos()
|
||||
love.graphics.draw(doorSprite[color], p.x + self.drawOffset.x, p.y + self.drawOffset.y, 0, drawScale, drawScale)
|
||||
love.graphics.draw(sprites.door[color], p.x + self.drawOffset.x, p.y + self.drawOffset.y, 0, drawScale, drawScale)
|
||||
end
|
||||
end
|
||||
love.graphics.setColor(gColor.white:set())
|
||||
local p = self:getDrawPos()
|
||||
love.graphics.draw(doorSprite["white"], p.x + self.drawOffset.x, p.y + self.drawOffset.y, 0, drawScale, drawScale)
|
||||
love.graphics.draw(sprites.door["white"], p.x + self.drawOffset.x, p.y + self.drawOffset.y, 0, drawScale, drawScale)
|
||||
else
|
||||
for color, active in pairs(self.colors) do
|
||||
love.graphics.setColor(gColor[color]:set())
|
||||
local p = self:getDrawPos()
|
||||
love.graphics.draw(doorSprite["unlocked"], p.x + self.drawOffset.x, p.y + self.drawOffset.y, 0, drawScale, drawScale)
|
||||
love.graphics.draw(sprites.door["unlocked"], p.x + self.drawOffset.x, p.y + self.drawOffset.y, 0, drawScale, drawScale)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue