diff options
| author | Eltrac <hi@guhub.cn> | 2025-02-25 11:41:55 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-02-25 11:41:55 +0800 |
| commit | ffa5f29b0c4d9cc92e6a19abb6b74234868db34a (patch) | |
| tree | 688971b34b7461ec6235a9085db7e4a5452af8f5 /data | |
| parent | e44f2469c66440004f2e57fae67e751744af334a (diff) | |
feat: big heart split into 4 red heart after hit
Diffstat (limited to 'data')
| -rw-r--r-- | data/bulletData.lua | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/data/bulletData.lua b/data/bulletData.lua index 41e4132..a4b8bff 100644 --- a/data/bulletData.lua +++ b/data/bulletData.lua @@ -1,12 +1,17 @@ local bulletData = { - redheart = { + bigheart = { afterShot = function () - print("Red heart fired") end, - afterHit = function () - print("Red heart hit") + afterHit = function (x, y, enemyType) + local w, h = love.graphics.getWidth(), love.graphics.getHeight() + local r = enemyData[enemyType].size + 10 + + bullets.fire("redheart", 0, 0, x-r, y-r) + bullets.fire("redheart", w, h, x+r, y+r) + bullets.fire("redheart", 0, h, x-r, y+r) + bullets.fire("redheart", w, 0, x+r, y-r) end - } + }, } return bulletData |
