Reputation: 1609
I am developing games with the composer
library of Corona SDK and I am facing a problem with design patterns. Let's say I have a bunch of modules
, that I make globally accessible in main.lua
. After thinking about how I would make communication between modules
easy, I came up with the approach to make the generated display objects
properties
of the module
. I first tried the oop approach but then I ended up wrestling through complicated parameter structures
, that passed the objects
which made debugging
a pain.
Is there any problem with this approach, that you can see? Do I need to rethink my approach for the sake of stability?
Thanks for your help!
Greetings, Nils
Upvotes: 1
Views: 103
Reputation: 1702
Maybe try use Custom Events to objects communication. Also read
Using custom events to make game objects communicate on Corona forum
Creating and Dispatching Custom Events in Corona SDK on YouTube
What is more I recommended you analyse three free and open source games from Ponywolf on Corona marketplace. I do it myself :)
Upvotes: 2