Visual Objects

Going through the Corona in 5 minutes everything has been working fine except for now that Ive gotten to Visual objects. I’ve tried typing in the code it gives and I’ve tried to copy and paste it into my Sublime editor but it still pops up with this error message:

File: main.lua

Line: 21

Attempt to index local ‘sky’ (a nil value)

stack traceback:

main.lua:21: in main chunk

 

Not sure what the problem is but this is what I’ve been trying to type and/or copy paste in:

 

local sky = display.newImage( “bkg_clouds.png” )

sky.x = 160; sky.y = 195

local ground = display.newImage( “ground.png” )
ground.x = 160; ground.y = 445

Please help with what is going wrong

There should be a terminal/console window open that may have more information. But what can help is what is line 21?  Ask yourself “Why is sky nil?” “How did sky get created?” Did something fail there?

Rob

Check the spelling and case of “bkg_clouds.png”.  Also make sure that file ( “bkg_clouds.png”)  exists and that it is in the root folder (same folder as main.lua).  You probably have it in the wrong place or have misspelled the file name.  

There should be a terminal/console window open that may have more information. But what can help is what is line 21?  Ask yourself “Why is sky nil?” “How did sky get created?” Did something fail there?

Rob

Check the spelling and case of “bkg_clouds.png”.  Also make sure that file ( “bkg_clouds.png”)  exists and that it is in the root folder (same folder as main.lua).  You probably have it in the wrong place or have misspelled the file name.