So I have been following Dr. Hernandez’s tutorials on game creation (If you haven’t watched them, go do it now http://www.youtube.com/user/cheetomoskeeto), and I have created a state machine to handle the logic of my game.
Now my question is, what is the best way to setup the state machine, such that I have the state machine in one location, and can edit / add features to the state machine, and make sure it is used by all my levels?
I am using the director class to handle the flow of the game, and each level is it’s own lua file.
If I keep the state machine as a module, and require it in to each level, is that going to work? I am passing in a reference to the state machine to the other modules that need it (Spawn.lua) which is required in main.lua. My thinking is that if the level gets loaded, and when it’s loaded it passes in a new reference to the Spawn module, I should be alright…right?
Thought’s?
Mike Hovland
Blue Rocket Labs
[import]uid: 5317 topic_id: 8480 reply_id: 308480[/import]