I’m very new to Corona but have been developing professionally for more than 10 years.
I’d like to build a simple game in Corona to get myself acquainted with it but seeing that I’m also new to Lua I would like to double check whether my way of thinking goes against (or not) the SDK.
I need to have a good amount of “creeps” on screen (think in terms of tower defense). What I would normally do would be to create a Creep class with generic properties, subclass it to create more specific creeps and as I add them to the screen I also add them to a master creep array. After that it’s just a matter of manipulating each according to what I want.
I am tempted to create a Creep class and have one of it’s properties be the actual DisplayObject and then have other custom properties/methods (somehow following the Composition design pattern). Or maybe just subclass DisplayObject and add to that.
Is this possible in Corona/Lua? Is this actually the way to go? How are people handling similar situations? I very much like code that’s easy to maintain and simple. So far I’m not too impressed by the structured-like code I’m seeing in a lot of non-official Corona blogs/tutorials and I understand this is not an inherent problem with the framework itself as many of these blogs/tutorials were written by people who are not programmers themselves but “users” of the framework if you will.
Definitely not trying to sound like a snob or anything! I just love to code, and having a lot of experience in other OOP languages I’d like to hear what other experienced Corona programmers have to say about it.
Cheers! [import]uid: 118884 topic_id: 28503 reply_id: 328503[/import]