It looks like you're new here. If you want to get involved, click one of these buttons!
function Sprite:collision(sprite2) local x,y,w,h = self:getBounds(stage) local x2,y2,w2,h2 = sprite2:getBounds(stage) return not ((y+h < y2) or (y > y2+h2) or (x > x2+w2) or (x+w < x2)) end
init.lua:5: ')' expected near ';'I'm trying to detect collision between two sprites. The thing is, I used this function in other projects in the past and it worked just fine. I'm obviously missing something, but I just can't get my head around it. Any ideas?