summaryrefslogtreecommitdiff
path: root/objects
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-03-12 23:26:52 +0800
committerEltrac <hi@guhub.cn>2025-03-12 23:26:52 +0800
commit93be21bd9694287397c96f0cf93c9565d53b6d61 (patch)
tree06840f96ad84101d2a5ab2fec2eaf38423d4a96d /objects
parent33cf1a9f7fe9a87923db11f8d1e2a7cf756a690a (diff)
feat(audio): play projectile sound when player shoots
Diffstat (limited to 'objects')
-rw-r--r--objects/Player.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/objects/Player.lua b/objects/Player.lua
index e53192d..9546162 100644
--- a/objects/Player.lua
+++ b/objects/Player.lua
@@ -75,7 +75,7 @@ function Player:shoot(target)
-- if no charging time is set, then set it and shoot no bullet
if not G.player.chargingStarted then
G.player.chargingStarted = G.time
- return
+ return false
end
-- if charging time is set, then check if it's over 1 second
-- if not, shoot no bullet
@@ -91,6 +91,8 @@ function Player:shoot(target)
table.remove(self.hearts)
G.player.shootCooldown = G.time + config.playerShootCooldown
+
+ return true
end
function Player:onContact(other, contact)