Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: callisto on Mon 28/04/2008 16:07:12

Title: room_LeaveBottom() function problem (SOLVED)
Post by: callisto on Mon 28/04/2008 16:07:12
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.

Title: Re: room_LeaveBottom() function problem
Post by: Dualnames on Mon 28/04/2008 16:16:27
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.
Title: Re: room_LeaveBottom() function problem
Post by: Pumaman on Mon 28/04/2008 18:16:51
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);
}
Title: Re: room_LeaveBottom() function problem
Post by: callisto on Tue 29/04/2008 15:49:49
Thank you!