summaryrefslogtreecommitdiff
path: root/objects
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-03-12 23:41:18 +0800
committerEltrac <hi@guhub.cn>2025-03-12 23:41:18 +0800
commit58e52cdaef4bbacb0989038d5a75994591bba815 (patch)
treeeee4da924b6331ca98f08994454880ae5c0ca963 /objects
parentdddfba911e0b78b13ce6687efaec523426101afe (diff)
feat(audio): enemy death sound
Diffstat (limited to 'objects')
-rw-r--r--objects/Enemy.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/objects/Enemy.lua b/objects/Enemy.lua
index 9c28c3c..36c238f 100644
--- a/objects/Enemy.lua
+++ b/objects/Enemy.lua
@@ -3,6 +3,7 @@ local Body = require "objects.Body"
local Loot = require "objects.Loot"
local enemyData = require "data.enemyData"
local FrameTimer = require "utils.frameTimer"
+local audio = require "utils.audio"
local Enemy = {}
Enemy.__index = Enemy
@@ -109,6 +110,8 @@ function Enemy:isDead()
end
function Enemy:die()
+ audio.play("hit")
+
-- drop loots
for i, item in ipairs(enemyData[self.type].drops) do
local temp = math.random(10) / 10