Tilemap as a tile in a tilemap

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
LaonFox
Prole
Posts: 2
Joined: Tue Aug 09, 2016 2:26 pm

Tilemap as a tile in a tilemap

Post 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.
Attachments
Not working dont know why.love
(33.25 KiB) Downloaded 152 times
Working proof of random generation.love
(33.23 KiB) Downloaded 146 times
palmettos
Prole
Posts: 14
Joined: Sun May 29, 2016 7:00 pm

Re: Tilemap as a tile in a tilemap

Post 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.
LaonFox
Prole
Posts: 2
Joined: Tue Aug 09, 2016 2:26 pm

Re: Tilemap as a tile in a tilemap

Post by LaonFox »

hmm. Ill have to give that a try. Thanks!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 4 guests