Rework collision code for future features.

This commit is contained in:
Anna Rose Wiggins 2023-09-30 15:47:26 -04:00
parent f6ae85dcb1
commit bb25e255a3
5 changed files with 27 additions and 29 deletions

View file

@ -15,9 +15,9 @@ function Entity:init(img, health, armor)
self:setCollideRect(0, 0, self:getSize())
-- most entities will be enemies, so we configure this mask by default
-- We don't set a collider mask because collision is always handled by
-- other objects (todo: consider player staying perfectly still)
self:setGroupMask(0x8)
-- We don't set a collider mask because collision is a bit too variable
-- (but we should always include 0x2 and handle player collisions)
self:setGroupMask(0x4)
end
function Entity:damage(amount)