   Generate 2D map in real time
  Hi,  I'm trying to create a basic 2D game where the map is generated in real time until the player dies (essentially an infinite terrain). It's a side scrolling game and I have around 5 different 'obstacles' and 2 different 'gradients' (uphill/downhill) that can be randomly spawned. Are there any articles/topics I should read about to achieve this? It sounds quite straightforward in theory, but I'd like to have a good understanding of the best way to achieve this so that I can optimize it.Thanks   
  you can move objects if player moves away from them and they are off screen. lets say your window size is 100x100 pixel. imagine a square centered on player with 200 pixel sizes. If an object moves out of this square you will recreate it on a random spot (but be sure that this spot is off screen) in square again.only 1/4 of the imaginary scene will be visible. if an object is further than 100 pixel in width or height to player, move it to another off screen spot on map (player position +- 50 pixels will be visible)but if player leaves an area and come back to it again he will notice that area is different now.;  Thanks for the help. The user won't be able to go back. I'm trying to create a slightly more advanced version of this:http://www.helicopter-game.org/Essentially, instead of green blocks, I would like to use textured objects. What would be the most optimized way of generating the level on the fly? I guess I could create a random number every frame which dictates the next object to show, but I'm not sure how efficient that is.;  Do you mean like a cross-screen game? Have a look on some game web-sites and you might get some good idears.Also if you want to have fun, make a birds-eye view war game like endless war 3. Those games are really fun.   ;  Hi Duck123,  I'm not sure what a 'cross-screen' game is, but I'm guessing it's side scrolling? If so, then yes. In my previous post I linked to an example of what I want to achieve (well, a more basic version, but same principles).   