I keep getting the same syntax error when trying to run my game. I don't know if I'm missing something or not.
the code is:
if btn(x button) and p1.landed=true then
It kept giving me the error 'then' expected near '='
You need to use "==" (two equals signs) for comparisons. One equals sign is only used for assigning a value to a variable.
So your code needs to be:
if btn(x button) and p1.landed == true then p1.y-p1.boost p1.landed=false p1.jumping=true end
Also "p1.y-p1.boost" should probably be "p1.y -= p1.boost" (subtract p1.boost from p1.y, updating p1.y)
[Please log in to post a comment]