switches and chex and so forthgit add -A wow
This commit is contained in:
parent
b553d3f664
commit
7fcbd9e5da
2 changed files with 45 additions and 13 deletions
11
switch.lua
11
switch.lua
|
|
@ -3,15 +3,18 @@ require "entity"
|
|||
Switch = class("Switch", Entity)
|
||||
|
||||
function Switch:initialize(x, y, color)
|
||||
print("hey!!", x, y, color)
|
||||
print(color)
|
||||
Entity.initialize(self, {
|
||||
x = x,
|
||||
y = y,
|
||||
sizeX = 1,
|
||||
sizeY = 1,
|
||||
color = color,
|
||||
collision = "none", --switches are floor elements that can't be pushed or bloc movement!!
|
||||
sprite = switchSprite[color]
|
||||
})
|
||||
|
||||
self.activated = false
|
||||
end
|
||||
|
||||
function Switch:activate()
|
||||
if self.activated == false then self.activated = true end
|
||||
print("i am: ", self.activated)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue