Create a long map like Doodle Jump : generate in advance VS generate instantly

Thanks for reading.

If you are going to make a game that has a long map like Doodle Jump, or a Tower Defense game, would you generate all the enemies randomly in advance (without drawing them), or generate them randomly only when some of the sprites on the screen have left?

I mean generating them by creating an array or appending an array that stores the enemies properties, without drawing them on the screen.

If you have experience in handling such situation, would you mind talking about the pros and cons on both sides?

Thanks very much. [import]uid: 12769 topic_id: 7859 reply_id: 307859[/import]

Finally I figured out that generating objects on the fly is much more flexible and has much higher performance. [import]uid: 12769 topic_id: 7859 reply_id: 28728[/import]

hi! can you tell us more about the solution you came up with? thanks! [import]uid: 24493 topic_id: 7859 reply_id: 29059[/import]