lutro-game-of-life/DeadCell.lua
2015-02-23 15:06:55 +01:00

20 lines
321 B
Lua

DeadCell = Cell.new()
DeadCell.__index = DeadCell
function DeadCell.new(n)
local self = setmetatable({}, DeadCell)
return self
end
function DeadCell:getColor()
return 153, 153, 153
end
function DeadCell:nextGeneration(neighbour)
if neighbour==3 then
cell=AliveCell.new()
else
cell = self
end
return cell
end