Page 1 of 1

Tilemap as a tile in a tilemap

Posted: Tue Aug 09, 2016 2:40 pm
by LaonFox
I want to use a randomly assigned tile map as a piece in a larger tile map. How do I go about doing this?

like so
where i and j are the cordinates of the larger array, and r and u are the cordinates of the smaller array
i, j i+roomx, j+roomy
r+i, u+j r+i, u+j
r+i, u+j+tiley
hope that helps.

attached is the working Random tile map generator, but with tiles. All I want is to replace the tiles with tilemaps and draw them.


wasd controls movement, n generates a new map.

Re: Tilemap as a tile in a tilemap

Posted: Tue Aug 09, 2016 7:39 pm
by palmettos
Hmm. Have you looked at Simple Tiled Implementation? You can load tilemaps made in Tiled Map Editor with offsets. You could just load them in a series using the width*col/height*row of the previous loaded maps as the current map's offset.

Alternatively, if you want to do it yourself, STI's source code and Tiled Map Editor's .lua tilemap output are great resources to learn from.

Re: Tilemap as a tile in a tilemap

Posted: Wed Aug 10, 2016 2:55 am
by LaonFox
hmm. Ill have to give that a try. Thanks!