Procedural/Infiinte tilemap

I want to create a hexagonal tile map that is infinite, and can be zoomed, a lot like the Civilization Series but 2D. How would I best go about doing that?

You might look at the Tiled Map Editor

I did. I mean, how do you procedurally generate and add tiles in cocos2d and keep scrolling it when the camera pans? Possibly scale it too.

I use a ParallaxNode for this.

I also use a few threads to calculate where the player is and what to load for the next tiles. I add the tiles to a vector and I push and pop from it. However, I am very comfortable around threads, mutexes, locks, etc. I can’t run coco2d in another thread but I can make objects in another thread and store them to use in the main thread.

1 Like

You put hexagonal tiles on a parrallax node? I’ll try that

Tile maps don’t have to be a top down look only.

1 Like

I know tile maps don’t have to, but that’s what I’m going for. Also, are you sure Parallax node is right for me? Like, I want the player to see a grid of hexagonal tiles. They should be able to infinitely move upwards, downwards, left and right and the hexagonal tiles should keep generating wherever they go. Should I just write a class myself that has a Sprite Batch Node or something and automatically generate tiles that way, or are there better alternatives in cocos2d?