Hello,
I know I have asked a lot on the storyboard and Rob has helped a lot. But if I can just grasp this a little more I will have it.
I have a basic game with one level like angry birds where I am throwing an object. Right now I am defining the object at the stop outside of any storyboard functions. It is called shoe because I am throwing a horse shoe. So at the top I am saying:
local shoe
In the enterScene function of the storyboard I have:
shoe = display.newImage( "gfx/shoe1.png",186,287)
And then at the bottom of the code outside of any storyboard functions I have:
function loop(e) local targetx = 300 - shoe.y if shoe.y \< 200 then local d = (game.y - (shoe.y - 200) ) d = d - game.y if game.y \< 950 then game.y = d end end end
I get an error on line 814 which is the first line of the function above saying attempt to index upvalue ‘shoe’ (a nil value) … Normally I get it as shoe is not defined. Attached is the entire program. I need it working in a storyboard because it will be one scene of an app. I had it working when everything was outside of the functions but it would not reload the scene. And no objects are added to the storyboard’s view. Where would I define each part of the var shoe? Maybe that would help me get the rest working right.
Thanks!