diff options
author | Aki <nthirtyone@gmail.com> | 2016-07-17 11:57:40 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2016-07-17 11:57:40 +0200 |
commit | 208a534b5c17914152097333b4b69e43289ae614 (patch) | |
tree | b6072e3a568dab97bf4305ceaa93f1bccde621c8 | |
parent | ccb596c7bfe6a83737d3847ca3930c8c1b335297 (diff) | |
download | roflnauts-208a534b5c17914152097333b4b69e43289ae614.zip roflnauts-208a534b5c17914152097333b4b69e43289ae614.tar.gz roflnauts-208a534b5c17914152097333b4b69e43289ae614.tar.bz2 |
Dead don't talk
-rw-r--r-- | player.lua | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -384,13 +384,13 @@ end -- DIE function Player:die () + self:playSound(1) self.combo = 1 self.lives = self.lives - 1 self.alive = false self.spawntimer = 1 self.body:setActive(false) self.world:onNautKilled(self) - self:playSound(1) end -- And then respawn. Like Jon Snow. @@ -404,6 +404,8 @@ end -- Sounds function Player:playSound(sfx) - local source = love.audio.newSource(self.sfx[sfx]) - source:play() + if self.alive then + local source = love.audio.newSource(self.sfx[sfx]) + source:play() + end end |