From 3787499248fdc2d2b881b20779911733eb2678ad Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 4 Jun 2016 15:14:05 +0200 Subject: Menu actually works now --- menu.lua | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'menu.lua') diff --git a/menu.lua b/menu.lua index 6f0681c..72c2087 100644 --- a/menu.lua +++ b/menu.lua @@ -70,7 +70,7 @@ function Menu:update(dt) self.countdown = 3 end if state and self.countdown < 0 then - self.__index = self:startGame() + self:startGame() end end @@ -110,12 +110,16 @@ end function Menu:controllerReleased(control, controller) end --- WARUDO -function Menu:startGame() +function Menu:getNauts() local nauts = {} for _,selector in pairs(self.selected) do table.insert(nauts, {selector:getSelectionName(), selector:getController()}) end - local world = World:new("default", nauts) - return world + return nauts +end + +-- WARUDO +function Menu:startGame() + local world = World:new("default", self:getNauts()) + changeScene(world) end \ No newline at end of file -- cgit v1.1