From d38941d363842f547ba3cd681ca22f2014f1ba49 Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 31 Jul 2016 08:50:53 +0200 Subject: Map selection --- menu.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/menu.lua b/menu.lua index 597415f..96d9fca 100644 --- a/menu.lua +++ b/menu.lua @@ -195,8 +195,18 @@ function Menu:controllerPressed(control, controller) end -- map selection chaos! if control == "left" then + if self.map ~= 1 then + self.map = self.map - 1 + else + self.map = #self.maplist + end end if control == "right" then + if self.map ~= #self.maplist then + self.map = self.map + 1 + else + self.map = 1 + end end end @@ -214,6 +224,6 @@ end -- WARUDO function Menu:startGame() - local world = World:new("default", self:getNauts()) + local world = World:new(self.maplist[self.map], self:getNauts()) changeScene(world) end -- cgit v1.1