Best ways to implement platforms outside of screen area in a side scroller game? (image attached)

In a side scroller game, when placing platforms that are not random but fixed-in-place, what are some ways to achieve this? (image attached)

I know you can give exact coordinates (X and Y) but when you have a really long level that goes on for a long time, those platforms that are outside of the screen would have some ridiculously lengthy X values in terms of coordinates. Or is this ok? 

Another theory I had was, if I were to take a few of those platforms and place them inside of a group…and as each group passes by a certain point in the screen, the next set of group shows up…so on and so forth. Would this be a better solution?

Anyone have other suggestions?

Thanks in advance.

Hi @starlight88,

The best approach is to find a way to place the platforms shortly before they enter the screen (it’s better for memory and performance as a whole). Even better would be to create a bunch of platforms in advance, hide the ones you don’t need far offscreen somewhere, and then move them into place when necessary. This approach definitely requires some more up-front effort, but it’s the best for performance, since those platforms won’t need to be created on the fly, but rather just moved into place (an extremely light process in regards to performance).

Of course, you can create new platforms on the fly, but if you have (say) dozens of new platforms being created in one game cycle, you may notice a slight skip on less-powerful devices.

Brent

Hi @starlight88,

The best approach is to find a way to place the platforms shortly before they enter the screen (it’s better for memory and performance as a whole). Even better would be to create a bunch of platforms in advance, hide the ones you don’t need far offscreen somewhere, and then move them into place when necessary. This approach definitely requires some more up-front effort, but it’s the best for performance, since those platforms won’t need to be created on the fly, but rather just moved into place (an extremely light process in regards to performance).

Of course, you can create new platforms on the fly, but if you have (say) dozens of new platforms being created in one game cycle, you may notice a slight skip on less-powerful devices.

Brent

Thank you so much for your help!

Star

Thank you so much for your help!

Star