diff options
| author | Eltrac <hi@guhub.cn> | 2025-03-12 23:41:18 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-03-12 23:41:18 +0800 |
| commit | 58e52cdaef4bbacb0989038d5a75994591bba815 (patch) | |
| tree | eee4da924b6331ca98f08994454880ae5c0ca963 /objects | |
| parent | dddfba911e0b78b13ce6687efaec523426101afe (diff) | |
feat(audio): enemy death sound
Diffstat (limited to 'objects')
| -rw-r--r-- | objects/Enemy.lua | 3 |
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 |
