Hello Guest

Author Topic: Advice on randomizing world using multiple tilemaps  (Read 3080 times)

brettjohnson

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 1
    • View Profile
Advice on randomizing world using multiple tilemaps
« on: August 15, 2014, 03:48:27 pm »
Hi, I'm working on a top down game where I'd like the world to be randomized each time you play. My plan:

1. Build each location, a house for example, as single tilemap prefab.
2. Have a large world tilemap that acts as the ground.
3. Randomly place each location tilemap. (For this I have a couple of ideas)
- option 1. Have another tilemap, equal in width and height to the world tilemap, but with tile size equal to the size of a location prefab tilmap. Each prefab would be placed as prefab tile.
- option 2. Instantiate and align each location tilemap in an appropriate position. (This option sounds like the better one, but wanted to make sure.)
4. Somehow merge the tiles from the location tilemaps into the world tilemap as layers. (Is this possible/useful/worthwhile?)

So what are your thoughts? Am I going about this in a good way?

Thanks

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Advice on randomizing world using multiple tilemaps
« Reply #1 on: August 16, 2014, 12:32:56 pm »
Hmm... If you're gonna do this from code, you should look into the API (http://2dtoolkit.com/docs/latest/html/classtk2d_tile_map.html). You can set and get tiles, and I recommend managing everything yourself. I wouldn't then use multiple layers unless you actually need them.