chroma_solstice/switch.lua

28 lines
573 B
Lua
Raw Permalink Normal View History

2015-03-15 05:26:47 -04:00
require "entity"
Switch = class("Switch", Entity)
function Switch:initialize(x, y, color)
Entity.initialize(self, {
x = x,
y = y,
color = color,
collision = "none", --switches are floor elements that can't be pushed or bloc movement!!
2015-03-25 01:38:53 -04:00
cellShape = {{x = 1, y = 1}},
2026-08-07 01:05:08 -04:00
sprite = loadSprite("art/game/switch_" .. color:sub(1, 1) .. ".png")
2015-03-15 05:26:47 -04:00
})
self.activated = false
end
function Switch:activate()
2015-03-15 13:54:47 -04:00
if self.activated == false then
self.activated = true
end
end
function Switch:deactivate()
if self.activated == true then
self.activated = false
end
2015-03-15 05:26:47 -04:00
end