Hi!! :DDD
Im a begginer at programming and trying to recreate Space Invader in Löve for Android. But im getting a syntax error that i can't quite understand why im getting it:
Error
Syntax error: bullet.lua:74: 'end' expected (to close 'function' at line 48) near '<eof>'
Traceback
[C]: at 0x97533909
[C]: in function 'require'
main.lua:15: in function 'load'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
It happens in a function that is supposed to handle the player's bullets, the player is supposed to have 5 bullets that he can shoot when they're not already on the screen.
I'd very thankful if anyone can help me with this, have a good day :))
Weird syntax error[ SOLVED ]
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Weird syntax error[ SOLVED ]
Last edited by Casfew on Wed Jan 12, 2022 5:13 am, edited 1 time in total.
- BrotSagtMist
- Party member
- Posts: 657
- Joined: Fri Aug 06, 2021 10:30 pm
Re: Weird syntax error
You are not closing the for loops at line 29 and 50 in bullets.lua with an _end_.
Be more careful with indents or get an editor which automatically checks for open blocks.
When you properly indent the block in the for loop you end up seeing a gap underneath, that way coders see where ends are missing.
Fixing another thing, that bullet self thingy is a nil value which you can bypass with _or_ , i get it to at least show the graphics. Looks chaotic tho.
Be more careful with indents or get an editor which automatically checks for open blocks.
When you properly indent the block in the for loop you end up seeing a gap underneath, that way coders see where ends are missing.
Fixing another thing, that bullet self thingy is a nil value which you can bypass with _or_ , i get it to at least show the graphics. Looks chaotic tho.
obey
Re: Weird syntax error
Thx so much now it's fixed
The self thingy was a typing error and the resolution diference probably was what messed up the graphics.
The self thingy was a typing error and the resolution diference probably was what messed up the graphics.
Who is online
Users browsing this forum: Google [Bot] and 7 guests