3D tile engine

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Code: Select all


struct sector
{
  ISceneNode* cube;
};

sector map[10][10];

for (int x=0; x<10; x++)
   for (int y=0; y<10; y++) {
      map[x][y].cube = smgr->addCubeSceneNode(10.0f, NULL, -1, core::vector3df(x*10,0,y*10));
  }

That should do the trick for you. If you want to know a sectors position you just do map[x][y].cube->getPosition();
Image Image Image
Chris.Bailey
Posts: 9
Joined: Thu Aug 14, 2008 7:20 am

Post by Chris.Bailey »

Ahhh yes that makes a lot more sense. Thanks! =)
Post Reply