🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

tile engine

Started by
1 comment, last by hemp 22 years, 7 months ago
How do you make a tile engine?
Advertisement
Pretty broad question but here goes (this might be a newbie way, btw )

The first thing I would do is make a multidimensional array and fill it with numbers. Each numbers would represent a tile. I would then read each element of the array and pass it to a function to draw the tile. This function would use two "for" loops. It would loop through the y coordinates, drawing row by row.

I think it would go something like this:

  int map[3][3] = {{1,1,1},                 {1,0,0},                 {1,0,1}};for (int y = 0; y < 2; y++){    for (int x = 0; x < 2; x++)    {        DrawTile(map[x][y]);    }}  


That''s just the main idea. Play around with it and see if you can get a simple maze working or something


Peon
thanks

This topic is closed to new replies.

Advertisement