sounds init

This commit is contained in:
Simon Kellet 2024-04-21 13:38:32 +01:00
parent aff6fa8cd3
commit 1e9953b3b7

View File

@ -27,6 +27,7 @@ function Bullet:update(dt)
and UserPlayer2.y < self.y + self.height and UserPlayer2.y < self.y + self.height
then then
UserPlayer2.health = UserPlayer2.health - 1 UserPlayer2.health = UserPlayer2.health - 1
GameSounds.hit:play()
Bullets1 = {} Bullets1 = {}
end end
end end
@ -40,6 +41,7 @@ function Bullet:update(dt)
and UserPlayer1.y < self.y + self.height and UserPlayer1.y < self.y + self.height
then then
UserPlayer1.health = UserPlayer1.health - 1 UserPlayer1.health = UserPlayer1.health - 1
GameSounds.hit:play()
Bullets2 = {} Bullets2 = {}
end end
end end
@ -52,6 +54,7 @@ function Bullet:update(dt)
elseif self.p == 2 then elseif self.p == 2 then
Bullets2 = {} Bullets2 = {}
end end
GameSounds.hit:play()
end end
end end
end end