Hello,
I am new to coding with Corona, and need a bit of help with the project on the ‘Getting Started’ guide. I have finished all existing chapters and then added some of my own stuff.
There is no problem with anything apart from when I try and play the game a second time (i.e. when I try and do either composer.removeHidden() or composer.removeScene( “game” ), the game crashes. The message is:
04:41:52.012 ERROR: Runtime error
04:41:52.012 C:\Users\Matthew\Documents\Corona Projects\StarExplorer\game.lua:87: bad argument #-1 to ‘newImageRect’ (Proxy expected, got nil)
04:41:52.012 stack traceback:
04:41:52.012 [C]: in function ‘newImageRect’
04:41:52.012 C:\Users\Matthew\Documents\Corona Projects\StarExplorer\game.lua:87: in function ‘_listener’
04:41:52.012 ?: in function <?:167>
04:41:52.012 ?: in function <?:169>
Line 87 is as follows:
local newAsteroid = display.newImageRect( mainGroup, objectSheet, 1, 102, 85 )
I don’t know if I’m meant to be putting anything in the scene:destroy block, but I don’t remember the guide mentioning it at all.
Thanks in advance for the help,
~Sulphate / Matthew
