diff options
author | Aki <nthirtyone@gmail.com> | 2016-07-31 08:50:53 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2016-07-31 08:50:53 +0200 |
commit | d38941d363842f547ba3cd681ca22f2014f1ba49 (patch) | |
tree | c93d6fdc0765bfbc189455817c403b9cf3600f9f /menu.lua | |
parent | 3423e4303fc61c1b9131b8709a6b95851e9459f1 (diff) | |
download | roflnauts-d38941d363842f547ba3cd681ca22f2014f1ba49.zip roflnauts-d38941d363842f547ba3cd681ca22f2014f1ba49.tar.gz roflnauts-d38941d363842f547ba3cd681ca22f2014f1ba49.tar.bz2 |
Map selection
Diffstat (limited to 'menu.lua')
-rw-r--r-- | menu.lua | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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 |