I'm working on generating an endless level game on Android. I've got the framework up and running and some physics, and now I'm getting to the point to where I need to think about how I'm going to generate and track the world around the player. I've been thinking about this for a while and I'm just not sure what to do from here. I was thinking I could just randomly generate objects and the background of the level as the player progresses. But the player needs to be able to move backward as well. If that is the case then I need to keep track of all of my objects, and in an endless game, doesn't that mean I'm going to have a metric ton of objects in memory? How do I store the data for the ground, trees, mountains and whatnot? What is the best practice for this sort of thing? My initial thought is, the grass, trees and mountains are inconsequential to the game, they're just background objects. I'm thinking I can set up a pattern that repeats for these (tree1,tree2,tree3 in an array that uses a formula to figure out where each object needs to be loaded based on where the player x,y coord is), and save myself some grief with keeping track of those. Is that pretty standard? What do I do about keeping track of enemies/objstacles/powerups? Also right now I'm using a camera class that uses OpenGL orthographic projection to change the Frustrum to follow the player around the map. I've seen some articles say keep the player in one spot and move everything around the player, and some say the camera is good as well. What is the best practice for this?
And lastly, if anyone knows of any good resources that are worth a read for a budding game developer, I'd love to hear about them. I've found a lot of material on frameworks, languages and whatnot, but nothing that tackles specific problems that developers run into and best practices for those sorts of things. Sort of a standard practices for various game types book? Nothing code specific, just ideas on how to tackle various problems.
Thanks!