Page 1 of 1

Multi-layered levels

PostPosted: Fri Feb 03, 2017 4:27 am
by ome6a1717
I'm curious on if you guys have any ideas on the best way to approach this:

I'm trying to make a platformer that has multiple Z axis layers (like entering a door and then being in that building without changing the layout)

Here are the ways my brain can process it


1. Have multiple "sets" of layers (Platforms1, Collision1, Enemies1, Player1, Platforms2, Collisions2, Enemies2, etc.) and set the layers visible/invisible based on which layer you're going to. This just gets a bit tricky dealing with coding enemies, any effects, and you will end up with a TON of layers.

2. Creating the tilemaps and enemy placements and all of that off screen for the indoor locations, and then set the position of those tilemaps, collision boxes, enemies, etc. offscreen when you go inside, and swap when you exit to the outside). The problem with this is that there is a lot of code required for each instance of this

3. Actually use another layout and set the enemies to persist - it wouldn't exactly be seamless, most likely, but it might still be the easier to navigate.

I'm curious if any of you have any other ideas? I really don't plan on having more than an outside and inside layout.

Re: Multi-layered levels

PostPosted: Fri Feb 03, 2017 8:07 am
by oosyrag
My first inclination would be to just build the indoor areas off screen, and teleport the player there when necessary.

Re: Multi-layered levels

PostPosted: Fri Feb 03, 2017 5:30 pm
by ome6a1717
@oosyrag oooo that's a much better idea. Thank you!