Can someone help me here? :
I wrote this function for the bottom edge:
function room_LeaveBottom()
{
Display("This is bottom edge");
}
but when reaching to the edge, the message apears and not goes away (even when pressing enter).
the game is stuck.
Well, i'd rather use regions instead. Draw them and use walk on to and walk of to. The game in your case gets stuck because the player leaves bottom edge constantly. try putting this:
return;
under the display function that might do the trick.
Well, what do you want to happen? Once the character has gone beyond the edge that function will keep running.
So either move him to another room, or walk him back. For example:
function room_LeaveBottom()
{
Display("This is bottom edge");
player.ChangeRoom(2);
}
OR:
function room_LeaveBottom()
{
Display("This is bottom edge");
player.Walk(player.x, player.y - 20, eBlock);
}
Thank you!