diff options
author | Aki <nthirtyone@gmail.com> | 2017-02-24 22:53:59 +0100 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-02-24 22:53:59 +0100 |
commit | 5f013c9ca7b7c642a723befc1bafcd9f432f2956 (patch) | |
tree | b58c7a8a22d0e9a9ef74fa11f3d11ba1b7ea6a8e /player.lua | |
parent | 7c37217f4bc21139b34fafd5cb140f483129a10c (diff) | |
parent | 044313ea34209417f6f3837ff3b0402a8eeb7ed5 (diff) | |
download | roflnauts-5f013c9ca7b7c642a723befc1bafcd9f432f2956.zip roflnauts-5f013c9ca7b7c642a723befc1bafcd9f432f2956.tar.gz roflnauts-5f013c9ca7b7c642a723befc1bafcd9f432f2956.tar.bz2 |
Merge branch 'sounds'v1.0-pre.5
Diffstat (limited to 'player.lua')
-rw-r--r-- | player.lua | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -205,6 +205,7 @@ function Player:controlpressed(set, action, key) if self.jumpnumber > 0 then -- General jump logics self.jumpactive = true + --self:playSound(6) -- Spawn proper effect if not self.inAir then self:createEffect("jump") @@ -436,11 +437,12 @@ function Player:respawn() self.body:setPosition(self.world:getSpawnPosition()) self.body:setActive(true) self:createEffect("respawn") + self:playSound(7) end -- Sounds -function Player:playSound(sfx) - if self.alive then +function Player:playSound(sfx, force) + if self.alive or force then local source = love.audio.newSource(self.sfx[sfx]) source:play() end |