HEELP!
Posted: Thu Mar 26, 2015 5:01 pm
Help! I'm trying to make a humble little game and lua is acting strange!
I have not one but TWO problems! Firstly, in my CheckCollision function, it keeps telling me that I am comparing a number with nil.
What?? I see nothing with a nil value here.
Also, it then tells me that I need to end my CheckCollision.
Here you can see that in my other piece of code, the only difference is in spacing. There is still one end in both of them.
So what is going on? Is it something else in my code, or what?
I have not one but TWO problems! Firstly, in my CheckCollision function, it keeps telling me that I am comparing a number with nil.
What?? I see nothing with a nil value here.
Code: Select all
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
Code: Select all
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
So what is going on? Is it something else in my code, or what?