From a828872e5160bbc657c106b4b349c14b671498ba Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 21 May 2016 01:21:42 +0200 Subject: First move into portraits and HUD --- world.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'world.lua') diff --git a/world.lua b/world.lua index da89755..6a7d132 100644 --- a/world.lua +++ b/world.lua @@ -56,8 +56,8 @@ function World:createPlatform(x, y, polygon, sprite) end -- Add new naut to the world -function World:createNaut(x, y, sprite) - table.insert(self.Nauts, Player:new(self, self.world, x, y, sprite)) +function World:createNaut(x, y, name) + table.insert(self.Nauts, Player:new(self, self.world, x, y, name)) end -- Add new cloud to the world @@ -168,6 +168,11 @@ function World:draw() for _,platform in pairs(self.Platforms) do platform:draw(offset_x, offset_y, scale, debug) end + + -- Draw HUDs + for _,naut in pairs(self.Nauts) do + naut:drawHUD(1, 1+(_-1)*33, scale) + end end -- beginContact @@ -178,6 +183,7 @@ function World.beginContact(a, b, coll) print(b:getUserData().name .. " is not in air") b:getUserData().inAir = false b:getUserData().jumpdouble = true + b:getUserData().salto = false b:getUserData():createEffect("land") end end -- cgit v1.1