So I just started learning how to use the Corona SDK to create games. Making an asteroid-field shooting type game, and came across this error when trying to play the game.
(I know there is almost an exact replica of this question, but it has 0 answers and the only comment does not apply to me.)
This is the full error + stack trace:
19:21:16.393 ERROR: Runtime error
19:21:16.393 C:\Users\Some User\Documents\Corona Projects\StarExplorer\game.lua:87: bad argument #-1 to 'newImageRect' (Proxy expected, got nil)
19:21:16.393 stack traceback:
19:21:16.393 [C]: in function 'newImageRect'
19:21:16.393 C:\Users\Some User\Documents\Corona Projects\StarExplorer\game.lua:87: in function '_listener'
19:21:16.393 ?: in function <?:167>
19:21:16.393 ?: in function <?:169>
Here is a hastebin of the game.lua, and here is a hastebin of the menu.lua class, which switches the scene from menu to game.
I can tell as much as line 87 is causing the issue, and that something is wrong with the arguments for newImageRect, but apart from that I have no clue.
The game runs and plays perfectly on first run, but attempting to replay it causes the error. The code which switches the scene in the menu file is on lines 13-17.
Any help is appreciated, sorry if I am being silly and missing something obvious.
Thanks!
EDIT: The error is caused when it attempts to remove the game.lua scene.