Rework collision code for future features.
This commit is contained in:
parent
f6ae85dcb1
commit
bb25e255a3
5 changed files with 27 additions and 29 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue