Hello everyone, I've been banging my head against this particular problem all afternoon, so I've turned to you all for assistance.
Essentially, I'm making a exploration/metroidvania style prototype, and I'm trying to initialize going between layouts when the player hits any of the borders on screen. The camera is currently fixed.
I'm attempting to arrange them on a sort of 'grid' formation by using the layout name to represent it's X and Y in relation to other layouts. Like so,
<img src="http://puu.sh/4rBmm.jpg" border="0" />
I'm attempting trying to design it in such a way that I don't have to type the exact layout name each time, but have it run a small script to determine the change in layout name (-x for right, +y for down, etc...) to arrive at the correct layout in relation to the one it was previously on.
However, it seems that when it transfers over to an alternate layout, it locks up, and won't go back as needed. I have it triggered on collision with 'layout change' sprites, and I have it navigating to the next layout like so,
<img src="http://puu.sh/4rBAs.png" border="0" />
The layoutTag object is an object on each layout that I use to establish the current layout name as instance variables, rather than characters.
Currently my thoughts of what might be going wrong are either,
a) It's not reseting the layoutTag object properly when the layout changes, so it arrives on the same number. This doesn't seem to be the case however, because debug texts have shown it reporting correctly on layout transition/start.
b) Since my layout name has negative numbers in it, perhaps that is locking it up somehow.
c) Or, option c, my personal favorite, my computer is possessed by devils and it's entirely borked.
I've looked on other posts for layout transitions, but all that I've seen so far are advancing layouts linearly, (1,2,3,4, etc) and not in a more nebulous 'coordinate' based system that I'm trying to create.
If anyone has any pointers I would appreciate it greatly. This little bit is the last of the 'engine' coding I have to do, after that it's all content creation and layout specific puzzles, objects, or bosses. :)