diff options
author | Aki <nthirtyone@gmail.com> | 2016-12-20 06:05:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-20 06:05:56 +0100 |
commit | 493a89fb354ee6ce667d29a7b96bb4fdd0f6697f (patch) | |
tree | d862856d4b62a6c996ea16211ebd321206e236b4 /world.lua | |
parent | ed6ad6687aeb5359af48bc97c1dbf5dd66842c9c (diff) | |
parent | 73bcd524906c51d43b22b3ea68c64b38f130bea6 (diff) | |
download | roflnauts-493a89fb354ee6ce667d29a7b96bb4fdd0f6697f.zip roflnauts-493a89fb354ee6ce667d29a7b96bb4fdd0f6697f.tar.gz roflnauts-493a89fb354ee6ce667d29a7b96bb4fdd0f6697f.tar.bz2 |
Merge pull request #16 from nthirtyone/menuv1.0-pre.4
Menu
Diffstat (limited to 'world.lua')
-rw-r--r-- | world.lua | 13 |
1 files changed, 3 insertions, 10 deletions
@@ -36,7 +36,7 @@ World = { } -- Constructor of `World` ZA WARUDO! -function World:new(map, ...) +function World:new(map, nauts) -- Meta local o = {} setmetatable(o, self) @@ -64,7 +64,7 @@ function World:new(map, ...) local map = map or "default" o:loadMap(map) -- Nauts - o:spawnNauts(...) + o:spawnNauts(nauts) -- Create camera o.camera = Camera:new(o) -- Play music @@ -110,14 +110,7 @@ function World:loadMap(name) end -- Spawn all the nauts for the round -function World:spawnNauts(...) - local params = {...} - local nauts = nil - if type(params[1][1]) == "table" then - nauts = params[1] - else - nauts = params - end +function World:spawnNauts(nauts) for _,naut in pairs(nauts) do local x,y = self:getSpawnPosition() local spawn = self:createNaut(x, y, naut[1]) |