Well I'm back here with a new question. I recently try to make few test with this wonderfull library viewtopic.php?t=83309
that i was looking for in a previews topic. Unfortunatly it seems that it's not handling collision stuff. So i try to add some classic
collision test but seems not working.
Code: Select all
-- collision rectangle
function CheckCollision(x1,y1,w1,h1, x2,y2,w2,h2)
return x1 < x2+w2 and
x2 < x1+w1 and
y1 < y2+h2 and
y2 < y1+h1
end
--Sprites
for i,v in ipairs(sprites) do
PM7.placeSprite(camera,spriteimg,v[1],v[2],0,8,8)
if CheckCollision(user.x,user.y,user.w,user.h,v[1],v[2],8,8) then
table.remove(sprites,v)
end
end
here is the complete test based on hatninja library: