0

I already have a function that can return a tile for a given position. I am trying to make it so that when I scroll around it will load new tiles on the fly. I am having trouble figuring out how to attack the problem. I am sure that someone must have done this before and I would prefer to not reinvent the wheel on this.

Can anyone point me to a tutorial or some example code?

If not, can perhaps help me figure out how to do this?

I am using Kobold2D and the map is not going to be static, it will be generated on the fly, Minecraft style.

Weston
  • 1,481
  • 1
  • 11
  • 31
  • Search for HKTMXTiledMap, either that or (and) the tilemap extension class in the cocos2d-iphone-extensions allow you to create tiles on the fly. If not, you can always display 4 separate tilemaps adjacent to each other and swap out tilemaps as you move across a tilemap's outer border. – CodeSmile Aug 21 '12 at 12:37
  • What extension are you talking about? TMXGenerator? – Weston Aug 23 '12 at 10:43

1 Answers1

0

CATiledLayer is perfect for this. However, I do not know if this will play well with Cocos2d.

Dhaval
  • 456
  • 1
  • 4
  • 6