summaryrefslogtreecommitdiffhomepage
path: root/world.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-12-20 06:05:56 +0100
committerGitHub <noreply@github.com>2016-12-20 06:05:56 +0100
commit493a89fb354ee6ce667d29a7b96bb4fdd0f6697f (patch)
treed862856d4b62a6c996ea16211ebd321206e236b4 /world.lua
parented6ad6687aeb5359af48bc97c1dbf5dd66842c9c (diff)
parent73bcd524906c51d43b22b3ea68c64b38f130bea6 (diff)
downloadroflnauts-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.lua13
1 files changed, 3 insertions, 10 deletions
diff --git a/world.lua b/world.lua
index 8f948ce..57b8cd7 100644
--- a/world.lua
+++ b/world.lua
@@ -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])