Ah, I didn't see the brace after that if statement. I'm used of having it on the line below which is what messed me up. I rechecked it and there's nothing missing then. Although I'm not sure if it makes a difference, shouldn't the main function be at the very bottom?
"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip
My 2D game - release on Jun 13th; My tutorials