I'm developing on Mac. I'm using playdate.graphics.sprite:alphaCollision(anotherSprite)
in a collision loop to determine if two sprites actually touch.
The code looks like this:
local hits = ball:overlappingSprites()
for key, other in pairs(hits) do
if not ball:alphaCollision(other) then
print("Not an alpha collision!")
goto continue
end
-- remove the other sprite...
::continue::
end
As far as I can tell this is the intended way of using this functionality. However when I run my game, it looks like this (gif from simulator):
When the ball touches the square enemy it should collide. It's picked up on collision rects, but it's failing the check for alpha collision, the log is spammed with Not an alpha collision!
which is unexpected.
What am I doing wrong?