Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Collision error — Gideros Forum

Collision error

Hello! I recently stumbled upon a problem.
I get the following error whenever I use this piece of code:
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
Error:
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?

Comments

Sign In or Register to comment.