basic serialization worx*
*
This commit is contained in:
parent
d76ace8f69
commit
973a8ab25b
41 changed files with 162 additions and 82 deletions
5
door.lua
5
door.lua
|
|
@ -2,7 +2,7 @@ require "entity"
|
|||
|
||||
Door = class("Door", Entity)
|
||||
|
||||
function Door:initialize(x, y, colors)
|
||||
function Door:initialize(x, y)
|
||||
Entity.initialize(self, {
|
||||
x = x,
|
||||
y = y,
|
||||
|
|
@ -13,7 +13,7 @@ function Door:initialize(x, y, colors)
|
|||
self.locked = true
|
||||
|
||||
self.colors = {}
|
||||
for _, color in pairs(colors) do
|
||||
for _, color in pairs({"red", "green", "blue"}) do
|
||||
self.colors[color] = true --these are currently loc_ed
|
||||
end
|
||||
end
|
||||
|
|
@ -41,6 +41,7 @@ end
|
|||
|
||||
function Door:setColors(colors)
|
||||
local offColors = {}
|
||||
|
||||
for color, off in pairs(colors) do
|
||||
if off then
|
||||
if self.colors[color] then self.colors[color] = false end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue