Hi All
Working on the Chapter2 “upward and Downward” tutorial for Corona. Searched the forums for something similar but did not find the answer. When I try to relaunch my app I get:
main.lua:106 attempt to index local ‘newAsteroid’ (a nil value) stack traceback:
main.lua in main chunk
main.lua:112 attempt to index local ‘newAsteroid’ (a nil value) stack traceback:
main.lua in main chunk
main.lua:118 attempt to index local ‘newAsteroid’ (a nil value) stack traceback:
main.lua in main chunk
if ( whereFrom == 1) then
– from left
newAsteroid.x = -60 –line 106
newAsteroid.y = math.random( 500 )
newAsteroid:setLinearVelocity( math.random( 40,120 ), math.random( 20,60 ) )
elseif ( whereFrom == 2 ) then
– from top
newAsteroid.x = math.random( display.contentWidth ) –line 112
newAsteroid.y = -60
newAsteroid:setLinearVelocity( math.random( -40,40 ), math.random( 40,120 ) )
elseif ( whereFrom == 3 ) then
– from right
newAsteroid.x = display.contentWidth + 60 – line 118
newAsteroid.y = math.random( 500 )
newAsteroid:setLinearVelocity( math.random( -120,-40 ), math.random( 20,60 ) )
end

