So basically, I have layouts 1, 2, 3, 4, 5.
We'll call 1 "home"
All large, with portals to different places.
When my player enters Layout City1 from Home, she enters at the bottom of the screen. So then she travels through the block and, on collision with the UID of an interact block I have hidden, she transports to a specific location in City 2. The same happens when she spawns into City 3 and Park.
How do I then make her spawn into a different, geographically appropriate location, when walking back through the city?
I'm sure this is super simple and I'm way overthinking it. I just have no idea what the heck I'm missing.
Add an instance variable "id" to portal sprites, set different ids for each portal, you can use numbers or text (say, "park_west_entrance"). Add another instance variable "target_id", set correct target/exit ids for it too. For example the eastern portal in City3 will have target_id="park_west_entrance".
When the character enters a portal, save Portal.target_id in a global variable Spawn_ID. On start of the new layout, spawn the character at the portal with id=Spawn_ID.
LesleyBeth Please refresh the page, I edited my post while you were reading it :)
Develop games in your browser. Powerful, performant & highly capable.
You are a lifesaver. Seriously.
That is so much easier than what I was trying to do!