In the current project I’m working on, just while getting basic mechanics down I have a main.lua, playScene.lua and testScene.lua.
Currently in main.lua I just enter straight into playScene.lua.
playScene.lua has a button that says ‘play’ and when pressed goes into testScene.lua.
Both only contain a few lines of code.
However as soon as I’m in playScene.lua it becomes a mess. I make a LOAD of sprite sequences and sprite options. I declare collision filters, set a speed variable which controls movement speed and all the code controlling the players movement is within this scene. Also all the code which controls shooting.
Now what I’m wondering is how I should manage this, obviously there is more in playScene that what I listed but what I listed are things which, to me, could be put inside separate modules.
Now questions on modules, say, for example if I were to put my movement function within a module, and then call it with a enterFrame listener would the movement work fully normally?
Is it possible to store all my sprite sequences and options inside another module?
Thanks in advance.