Hi there Corona community,
——————————————————————————————————————————————————————————
I’m creating a game using composer & trying to implement OOP practices. I’m a beginner programmer and this will be my first app.
——————————————————————————————————————————————————————————
In my game, any objects that have complex behaviours are created & handled in separate classes/modules.
When the levels are first created these objects are instantiated in scene:show but when they are destroyed they are recreated by their own class modules.
When these objects are recreated by their own modules they go through transitions & timers which change things like scale & position & setFrame, etc.
When I leave the gameplay scene my transitions & timers from the modules are still running & cause runtime errors.
So I’m wondering if the whole layout of my game & code is completely wrong.
I’m after some general guidelines for what I can put in the classes (modules) & what has to go in the composer scenes.
——————————————————————————————————————————————————————————
Q1). I’ve been passing the sceneGroup as a parameter from the composer level to any module that instantiates an object itself. Is this OK?
Q2). Is it simply that all timers,transitions & replacement of objects has to occur in the composer scene?
Q3). Should classes & modules only contain object attributes & simple object methods/functions that are not based on timers or transitions?