🎉 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!

I was wondering if there is any place..

Started by
1 comment, last by Sephiroth 24 years, 7 months ago
To make a simple tile engine is pretty easy.

Here is some sample code of how to plot tiles:

// loop variables
int lx, ly;
// destination of tiles
int destx, desty;
// destination on map
int mx, my;

// the map array
int map[MAPXSIZE][MAPYSIZE];

for (ly = 0; ly<20; ly++)
{
for (lx = 0; lx<20; lx++)
{

destx = lx * TILEXSIZE;
desty = ly * TILEYSIZE;

drawtile(destx,desty,map[lx+mx][ly+my]);
};
};


To add scrolling all u would do is add an offset to destx, and desty, so it's pretty simple. This code may not compile but it shows how to make the actual tile engine.

Good Luck!

Later,

Da_KiD

Advertisement
I can get some sample code on a simple tile engine. If you have any idea, could you please email me at Seph@telebot.com

Thanks!

http://www.gamedev.net/reference/docs/refarticlelistuser.asp?catid=44
William Reiach - Human Extrodinaire

Marlene and Me


This topic is closed to new replies.

Advertisement