summaryrefslogtreecommitdiffhomepage
path: root/player.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-02-24 22:53:59 +0100
committerAki <nthirtyone@gmail.com>2017-02-24 22:53:59 +0100
commit5f013c9ca7b7c642a723befc1bafcd9f432f2956 (patch)
treeb58c7a8a22d0e9a9ef74fa11f3d11ba1b7ea6a8e /player.lua
parent7c37217f4bc21139b34fafd5cb140f483129a10c (diff)
parent044313ea34209417f6f3837ff3b0402a8eeb7ed5 (diff)
downloadroflnauts-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.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/player.lua b/player.lua
index 6195da6..775dd60 100644
--- a/player.lua
+++ b/player.lua
@@ -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