summaryrefslogtreecommitdiffhomepage
path: root/menu.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-07-31 08:50:53 +0200
committerAki <nthirtyone@gmail.com>2016-07-31 08:50:53 +0200
commitd38941d363842f547ba3cd681ca22f2014f1ba49 (patch)
treec93d6fdc0765bfbc189455817c403b9cf3600f9f /menu.lua
parent3423e4303fc61c1b9131b8709a6b95851e9459f1 (diff)
downloadroflnauts-d38941d363842f547ba3cd681ca22f2014f1ba49.zip
roflnauts-d38941d363842f547ba3cd681ca22f2014f1ba49.tar.gz
roflnauts-d38941d363842f547ba3cd681ca22f2014f1ba49.tar.bz2
Map selection
Diffstat (limited to 'menu.lua')
-rw-r--r--menu.lua12
1 files changed, 11 insertions, 1 deletions
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