I'm trying to figure out how to make my character walk to a different points after entering from different edge. So if he enters from the left edge, he goes somewhere, the right edge, somewhere else. That sort of thing. Any help would be appreciated :=
Just check player.PreviousRoom.
function room_AfterFadein() {
// entered from left edge
if (player.PreviousRoom == 2) player.Walk(30, 120);
...
}
If you don't want to use the room numbers all the time, you could also check the player's coordinates:
// entered from top edge
if (player.y < 20) ...
Also, if you want to make them walk into the room from off-screen, then you'll need to pass the BlockingStyle and WalkWhere parameters (you have to pass BlockingStyle because it comes before WalkWhere):
player.Walk(x, y, eBlock, eAnywhere);
By default the parameter is set to use eWalkableAreas.
Yup. That works. Thanks guys :=