basic serialization worx*

*
This commit is contained in:
0x81c 2015-03-17 01:59:14 -04:00
parent d76ace8f69
commit 973a8ab25b
41 changed files with 162 additions and 82 deletions

View file

@ -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