From 93be21bd9694287397c96f0cf93c9565d53b6d61 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Wed, 12 Mar 2025 23:26:52 +0800 Subject: feat(audio): play projectile sound when player shoots --- objects/Player.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'objects') 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) -- cgit v1.2.3