Hi all,
I’m reaching out right now to gain a little more understanding of LUA and Corona SDK in terms of the creation of “objects” within a program. At the current point in time, I am creating a game which involves various ships flying across the screen while the player tries to dodge and shoot them. So far, it is functional (not very efficient though :P).
My one problem is understanding how to create many objects of the same type (you’ll have to forgive me, I normally program in Object-Orientated languages). For instance if I want a ship with properties and its own functions, how could I create more than one instance of these. Currently, I can only have one of each object on the screen as allowing more on would mean that when one is destroyed, so would the rest. I currently use a table which removes objects that are placed within it each game frame,
for i = 1, #toRemove do
toRemove[i].parent:remove(toRemove[i])
toRemove[i] = nil
end
Basically what I’m asking is how to have many objects of the same kind on the screen at once, all dynamic from eachother so they can be destroyed separately.
(sorry for rambling a bit, hope i got the idea across)
Any help would be appreciated,
Regards, Louis [import]uid: 65150 topic_id: 19533 reply_id: 319533[/import]

[import]uid: 52491 topic_id: 19533 reply_id: 75429[/import]