Hello all,
I am new to Corona and currently laying out my first game.
My background is in ObjectiveC with several native apps on the AppStore.
I am wondering how you guys structure your games internally since LUA doesn’t support OOP.
As a practical example, let’s take an arcade space shooter.
In other languages, I’d create a class for all objects that move across the screen and interact, namely the player, enemies and obstacles.
That class would have the properties “health”, “damage”, etc and the methods to handle them.
Then the classes “Player”, “Enemy” and “Obstacle” would inherit from it and add their specific functionality.
In the end, all events only trigger class methods or create new objects from classes.
While researching on Google, I found that LUA supports inheritance by manipulating the metatable. There are also a few frameworks that slap OOP onto LUA.
However, since LUA is not object oriented by design, I am figuring most games developed in Corona get along without this paradigm.
Thus the question - how do you structure your games internally?
Do events simply call functions that set up the complete entity?
What has worked best for you?
Thank you for taking the time to share your experiences.
–0x90 [import]uid: 10292 topic_id: 3422 reply_id: 303422[/import]
