Jump to content

Creating an infinite grid?


Teonnyn
 Share

Recommended Posts

I'm creating a game that requires a grid, and while I've got the basics down, I'd like it to turn a finite grid into infinite that can be scrolled in all directions.

How would I go from this: 

function CreateHexGrid()
{
    for(var x=0; x< mapSize; ++x) {
      gameMap[x] = [];
      for (var y=0; y < mapSize; ++y) {
		var square = new diamondTile(game, x, y);
		gameMap[x][y] = square;
		gameContainer.add(square);
      }
    }	


	game.world.setBounds();
}

to infinite? 

The image I have describes the results I have thus far.

 

648af0b32c2b0c0b0a19dd97b3854592.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...