Need help with storyboard layout!

Hey guys, i have been having trouble with out my game with story and have had multiple goes at trying to fix it, can you please set it out for  me as i am really confused on what to do.

 Please help me out i’m really urgent. thanks! :slight_smile:

what i need fixing is in the file i have attached.

Cheers, Hazza

No file is attached.

Take a look at this article.

http://www.develephant.net/a-simple-storyboard-framework-for-corona-sdk-part-1/

Cheers.

so does it really matter were you put the functions in storyboard?

The short answer is yes.  The longer answer involves discussing “scope” which is a fundamental concept to programming in LUA especially.

If you place any functions inside of the scene:enterScene , scene:exitScene , etc. those functions are only accessible from within the scene method that the function is placed in (we assume all functions are local).  If you want access to a function anywhere in your scene then you would declare it outside of the scene methods.  If you want to access your function in any scene, or anywhere in your application, you would use a module.

This is a very short answer, and does not touch upon other details like forward-referencing, adding the function to the scene itself – which would allow you to use it in any scene method within the current scene, etc.

I recommend you search around for LUA articles that discuss scope.  The sooner you understand it, the sooner you’ll be making the next killer app.

Hope that helps.

Cheers.

would you rather chose storyboard over director class? im on a real struggle chosing between them as i switch between storyboard to director class

Storyboard is developed by and officially supported by CoronaLabs, so I’d recommend using Storyboard.

ok thanks

No file is attached.

Take a look at this article.

http://www.develephant.net/a-simple-storyboard-framework-for-corona-sdk-part-1/

Cheers.

so does it really matter were you put the functions in storyboard?

The short answer is yes.  The longer answer involves discussing “scope” which is a fundamental concept to programming in LUA especially.

If you place any functions inside of the scene:enterScene , scene:exitScene , etc. those functions are only accessible from within the scene method that the function is placed in (we assume all functions are local).  If you want access to a function anywhere in your scene then you would declare it outside of the scene methods.  If you want to access your function in any scene, or anywhere in your application, you would use a module.

This is a very short answer, and does not touch upon other details like forward-referencing, adding the function to the scene itself – which would allow you to use it in any scene method within the current scene, etc.

I recommend you search around for LUA articles that discuss scope.  The sooner you understand it, the sooner you’ll be making the next killer app.

Hope that helps.

Cheers.

would you rather chose storyboard over director class? im on a real struggle chosing between them as i switch between storyboard to director class

Storyboard is developed by and officially supported by CoronaLabs, so I’d recommend using Storyboard.

ok thanks