cleanup: QOL improvements — gitignore, Tags constants, remove debug artifacts
- Add .DS_Store, unused/, .vscode/settings.json to .gitignore - Add .editorconfig (tabs for Lua, LF, UTF-8) - Fix duplicate submodule entry in .gitmodules - Add Tags table (player, tank, ground, granade, ammoCrate) — replace magic numbers - Add SCREEN_W/SCREEN_H constants - Fix leaked global variable `c` in Game.lua - Remove Noble.showFPS = true from BomberScene - Remove debug print() calls from granade, enemy, BomberScene - Fix clean_build_dir glob bug in both build scripts - Make PLAYDATE_SDK_PATH configurable via env var
This commit is contained in:
@@ -65,8 +65,7 @@ function Enemy:update()
|
||||
|
||||
if numberOfCollisions > 0 then
|
||||
for i, collision in ipairs(collisions) do
|
||||
if collision.other:getTag() == 154 and collision.other.currentRadius <= 0.05 and not self.isDying then
|
||||
print("Collision with granade")
|
||||
if collision.other:getTag() == Tags.granade and collision.other.currentRadius <= 0.05 and not self.isDying then
|
||||
self:setImage(self.deadImage)
|
||||
self.hitSound:play()
|
||||
self:applyExplosionForce(collision.other.x, collision.other.y)
|
||||
@@ -74,9 +73,8 @@ function Enemy:update()
|
||||
end
|
||||
end
|
||||
|
||||
if self.y > 240 + 10 then
|
||||
if self.y > SCREEN_H + 10 then
|
||||
if not self.removed then
|
||||
print("Removing enemy")
|
||||
self:remove()
|
||||
self:superRemove()
|
||||
self.removed = true
|
||||
|
||||
Reference in New Issue
Block a user