Page 1 of 1

'=' expected near 'player'

Posted: Sun Dec 07, 2014 11:15 am
by Valcos
I'm pretty new to Love2d and have done a lot of guessing, but can somebody tell me what's wrong with this?

I'm getting the error: '=' expected near 'player'

From this code:
If player.x > 200 and
player.x < 1080 then
player.x = getMouse.x(dt)
end

Re: '=' expected near 'player'

Posted: Sun Dec 07, 2014 1:24 pm
by bartbes
If you use the

Code: Select all

 tags on the forums, the formatting will be preserved. The problem seems to be, however, that you wrote 'if' as 'If'.

Re: '=' expected near 'player'

Posted: Sun Dec 07, 2014 3:17 pm
by Doctory
nope, its an i
did you define the function getMouse.x?

Re: '=' expected near 'player'

Posted: Sun Dec 07, 2014 3:30 pm
by bartbes
I did write an I, just a capital one.

Re: '=' expected near 'player'

Posted: Mon Dec 08, 2014 12:42 pm
by Jasoco
The point is, if the code in the OP is exact, bartbes is right. You capitalized the word "if". (Lua is case sensitive)