MenuState = inherited("MenuState", State)

function MenuState:new()
	local o = instance(self)
	o.players = {}
	return o
end

function MenuState:init()
	self.seed = os.time()
	self.start_level = 1
	self.max_level = 100
	self:add_player_with_input(1)
	self:start_game()
end

function MenuState:update(time)
end

function MenuState:keyPressed(key)
end

function MenuState:add_player_with_input(inputId)
	local input = inputs[inputId]
	if input and not self.players[inputId] then
		local p = Player:new(inputId)
		self.players[inputId] = p
		p:set_input(inputs[inputId])
	end
end


function MenuState:start_game()
	local gs = GameState:new(self.players, self.seed, self.start_level, self.max_level)
	states.add(gs, "game")	
end

function MenuState:render()
end

function MenuState:close()
end
