I have a simple question. Some explination first, however:
I am using libGDX and making a Legend of Zelda-type top-down game and I'm having an issue with map transitions. When I made the tilemap and added the (currently crappy) collision detection to it, I noticed that the IDE threw an error when the character walks off the map (where there are no tiles to test the collision possibility against). I thought, cool, I can use that.
Knowing that the program would throw an exception when the player left the screen, I caught that exception and used it to decide to which map the player was trying to transition and switch accordingly. I played a little transition from the scene2d actions and to the next map we went.
BUT, I got to thinking that while catching that exception is a great thing, I probably shouldn't rely on it for map transitions. I'm betting you all will agree: handle the exception just in case, but don't rely on it.
SO, this means that I need to handle a transition before the user gets off the map. I tried using transition tiles from within the collision detection:
If the tile had the transition property, figure out where the user is attempting to transfer and then play the transition effect and on to the next map. The only problem with this system is that it doesn't look right. The user transitions just as collision is made while there is still room left in the tile to transverse.
My question to you all, then, is this: Is there a middle ground between the two? Is there a way to tell end of map or last tile, allow the user to transverse the tile just prior to transitioning? Or are my two ways the only ones?