diff options
author | Aki <nthirtyone@gmail.com> | 2016-06-01 22:24:38 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2016-06-01 22:24:38 +0200 |
commit | 52609cc49d88f5b0d8610b5f6b792f0f423dc735 (patch) | |
tree | 4243590824e0f1b88ce3b568c483ef0af0a7b3f9 /world.lua | |
parent | 9ff0d70933474f3a7c50f7c3c0fa52fffaa9cf75 (diff) | |
download | roflnauts-52609cc49d88f5b0d8610b5f6b792f0f423dc735.zip roflnauts-52609cc49d88f5b0d8610b5f6b792f0f423dc735.tar.gz roflnauts-52609cc49d88f5b0d8610b5f6b792f0f423dc735.tar.bz2 |
Menu menu menu -- still not complete
Diffstat (limited to 'world.lua')
-rw-r--r-- | world.lua | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -75,10 +75,17 @@ end -- Spawn all the nauts for the round function World:spawnNauts(...) - local nauts = {...} + local params = {...} + local nauts = nil + if type(params[1][1]) == "table" then + nauts = params[1] + else + nauts = params + end for _,naut in pairs(nauts) do local x,y = self:getSpawnPosition() - self:createNaut(x, y, naut) + local spawn = self:createNaut(x, y, naut[1]) + spawn:assignController(naut[2]) end end @@ -95,7 +102,9 @@ end -- Add new naut to the world function World:createNaut(x, y, name) - table.insert(self.Nauts, Player:new(self, self.world, x, y, name)) + local naut = Player:new(self, self.world, x, y, name) + table.insert(self.Nauts, naut) + return naut end -- Add new cloud to the world |