Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Exit Map from any edge without multiple events

TheUnproPro

Boondoggle
Staff member
Resource Team
Partner
Video:

This can be done with 1 simple trick =D

Make a parallel process and make sure you take note of your maps width and height. Mine was 40x40, so I subtract by 1 to get a result of 39x39.

You're going to want to make 2 variables, Player X and Player Y and set them equal to Game Data - Character - Player - Map X and Map Y

◆Control Variables:#0007 player X = Map X of Player
◆Control Variables:#0008 player Y = Map Y of Player

Create a conditional branch to check if his X is 0 or the width of the map minus 1 (39 in my case :D )

◆If:player X = 0
◆Transfer Player:World 1 (45,20)

:End
◆If:player X = 39
◆Transfer Player:World 1 (45,20)

:End

Do the same with Y except the map height.
◆If:player Y = 0
◆Transfer Player:World 1 (45,20)

:End
◆If:player Y = 39
◆Transfer Player:World 1 (45,20)

:End

That's all there is to it =D Of course you'd change the location transfers.
 
Top