Archived

This topic is now archived and is closed to further replies.

DJ_House

Tile Engine

Recommended Posts

DJ_House    122
What is the basis of a tile engine? Say I want to create a Super Mario style... do I create many screens which are 640x480 wide, and simply clip them? I want to avoid wide surfaces at all costs since they''re not widely supported.

Share this post


Link to post
Share on other sites
Kaewan    122
Although that method is possible, It is not generally implemented due to several factors. I won''t go into the details of why.

The better way is to create smaller "tiles" such as 16x16 images or 32x32. Then, you just have to "tile" them together to create a larger image that can be any size.

You could have a tile of a brick, another of a coin, grass, ice, etc... anything you can imagine. Even your characters can be made of a tile or multiple tiles.

"Tiling" them together is when you place multiple tiles next to each other to create a larger image.

The larger image is usually implemented by using a "map". Probably the most simple way is the use of a 2d array.

Etc: 2d array
1000010000
0001000000
0000000001
2222222222
3333333333

0 = sky
1 = cloud
2 = grass
3 = dirt

Imaging the numbers being replaced by a 16x16 image of what it represents.... there you go!

Happy coding,
Kaewan

Share this post


Link to post
Share on other sites
Yoshi    122
There is a tutorial about tile engines on my website:
www.remagination.com

Yoshi

The last truth is that there is no magic(Feist)

Share this post


Link to post
Share on other sites