Log In  

I made a function to check collision beetween 2 8x8 locations (sprites) using tables.
For some reason, it says that item2 (not item1, that ones ok) is a nil value when i use it.
Any ideas?

-- collision --

function coll(item1,item2)

rx=abs(item1.x-item2.x)
ry=abs(item1.y-item2.y)

if rx < 9 and ry < 9 then
return true
else
return false
end

end

P#129707 2023-05-14 06:40

always assume pico8 errors are valid - eg item2 is nil.
we are missing the full code to help here...

P#129708 2023-05-14 07:50

Could be, ill post the full code in another post. Please do note that i had only full access to pico 8 from yesterday. Summary, im a noob :P

P#129710 2023-05-14 08:25

[Please log in to post a comment]