Spawning sets of obstacles
Hi all,
I'm in the early stages of a game that is effectively a side scroller where the hero is moving in the x direction and needs to avoid obstacles (by moving up or down in the y direction) as he encounters them. I've watched a few helpful videos about using tables to spawn random or pre-programmed actors in specific locations and have made use of that. I've generated a few different tables of obstacle locations which I can call to spawn when the actor gets to a specific location on the screen.
I had thought that it would make sense to have the scene wrap in the x direction, and have the obstacles spawn ahead of the hero (so you can't see them spawn) and despawn behind the hero to create a seamless stream of obstacles, but it seems a little glitchy. When the hero wraps around in the x direction, it seems like obstacles are disappearing and reappearing. Would it make more sense to have a very long scene (a few thousand pixels wide) and have the obstacles already placed? From a logic standpoint, would that be easier? And from a memory standpoint, could that start to slow the game down?
Thanks,
AirshipScientist
Comments
What you propose makes perfect sense. Try the idea in a prototype and test to see if it improves performance. Then let us know!