This demo shows a practical method for generating an infinite game world through lazy tile generation and destruction with smooth scrolling. The key is the use of a seeded random number generator. These techniques create a consistent and efficient game map that feels infinite while only rendering what is necessary at any given time. Tiles are destroyed when not needed but because of the nature of the seeding, they are easily regenerated.
Use the ⬅ Left and ➡ arrow keys to turn the snake.