diff options
author | Aki <nthirtyone@gmail.com> | 2016-05-22 16:29:12 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2016-05-22 16:29:12 +0200 |
commit | bbee57ad4fbb9a12c5e3947fcee68657d0fa52c5 (patch) | |
tree | f6435fb85afb221688cb802bc90664d10a9a48b9 /player.lua | |
parent | b9fd32317e2af74ab6c9fb410666c26793d4f7a6 (diff) | |
download | roflnauts-bbee57ad4fbb9a12c5e3947fcee68657d0fa52c5.zip roflnauts-bbee57ad4fbb9a12c5e3947fcee68657d0fa52c5.tar.gz roflnauts-bbee57ad4fbb9a12c5e3947fcee68657d0fa52c5.tar.bz2 |
Map loads from file
Diffstat (limited to 'player.lua')
-rw-r--r-- | player.lua | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -149,8 +149,9 @@ function Player:update (dt) -- # DEATH -- We all die in the end. - if (self.body:getX() < -600 or self.body:getX() > 780 or - self.body:getY() < -500 or self.body:getY() > 500) and + local m = self.world.map + if (self.body:getX() < m.center_x - m.width*1.5 or self.body:getX() > m.center_x + m.width*1.5 or + self.body:getY() < m.center_y - m.height*1.5 or self.body:getY() > m.center_y + m.height*1.5) and self.alive then self:die() @@ -349,7 +350,7 @@ end function Player:respawn () self.alive = true self.body:setLinearVelocity(0,0) - self.body:setPosition(290/2, 180/2-80) + self.body:setPosition(self.world:getSpawnPosition()) self.body:setActive(true) self:createEffect("respawn") self:changeAnimation("idle") |