- [NEW] modul 'templates'

- [FIX] El primer frame de les animacions no es veia
-  [NEW] L'heroi ja dispara
- [NEW] Les momies ja moren (petada, arreglar)
This commit is contained in:
2025-06-26 14:06:34 +02:00
parent 47c7edde46
commit 8ba0ca9163
7 changed files with 218 additions and 50 deletions

View File

@@ -9,5 +9,18 @@ util={
else
return false
end
end,
aabb = function(sprite)
local x = sprite.pos.x + sprite.bbo.left
local y = sprite.pos.y + sprite.bbo.top
local w = sprite.size.w - sprite.bbo.right - sprite.bbo.left
local h = sprite.size.h - sprite.bbo.bottom - sprite.bbo.top
return x, y, w, h
end,
check_aabb_collision = function(x1,y1,w1,h1, x2,y2,w2,h2)
return ( x1 < x2 + w2 and x1 + w1 > x2 and y1 < y2 + h2 and y1 + h1 > y2 )
end
}