newbie in need of help

hiya guys and gals

I’ve downloaded the demo of corona SDK and I’m trying to create the demo where the box falls from sky and lands on ground, when typing the code out on refresh i keep getting an error as listed below Cheers matthew :wink:

stack traceback:

    [C]: ?

    …oronaSDK/SampleCode/Physics/Bridge/project1/main.lua:12: in main chunk

 

 

 

 

Hey there, first of all we need to see the code itself to figure out what may be the problem, many problems like this

shows that you have defined something like a variable and tried to make use of it maybe in a function or in general 

on the lines before it is even created.

That means that maybe you should define all the variables at the top/start of the code and then make use of them.

(it’s not like in as3 in that manner)

good luck Matthew.

hi thanks for the reply this is the code I’ve started, its just the basic demo one, which I’m trying to create my self and then if works play around with it a bit


– main.lua


local physics = require (“physics”)

physics.start()

local bluesky = display newImage (“bluesky”)

also I’m new to mac so still learning the os thanks again for the reply smithsun :slight_smile:

No problem, going over you code it seems that you left the image file type not unmentioned.

you would want to write it like this:

local bluesky = display newImage (“bluesky.jpg”)    – that means if its an jpg/jpeg image file. if it’s a png file just replace jpg with png

also you would want to check that the image file is in the same folder as the main.lua file,

otherwise just write :

local bluesky = display newImage (“folderName/bluesky.jpg”)  – when folderName is the name you gave to your folder where the images are located.

hope it helps.

good luck again

thanks the help smithsun i shall have a go now, your a great help  :smiley:

Hey there, first of all we need to see the code itself to figure out what may be the problem, many problems like this

shows that you have defined something like a variable and tried to make use of it maybe in a function or in general 

on the lines before it is even created.

That means that maybe you should define all the variables at the top/start of the code and then make use of them.

(it’s not like in as3 in that manner)

good luck Matthew.

hi thanks for the reply this is the code I’ve started, its just the basic demo one, which I’m trying to create my self and then if works play around with it a bit


– main.lua


local physics = require (“physics”)

physics.start()

local bluesky = display newImage (“bluesky”)

also I’m new to mac so still learning the os thanks again for the reply smithsun :slight_smile:

No problem, going over you code it seems that you left the image file type not unmentioned.

you would want to write it like this:

local bluesky = display newImage (“bluesky.jpg”)    – that means if its an jpg/jpeg image file. if it’s a png file just replace jpg with png

also you would want to check that the image file is in the same folder as the main.lua file,

otherwise just write :

local bluesky = display newImage (“folderName/bluesky.jpg”)  – when folderName is the name you gave to your folder where the images are located.

hope it helps.

good luck again

thanks the help smithsun i shall have a go now, your a great help  :smiley: