Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Hans on Sat 17/02/2007 00:22:07

Title: Problem with turning character (Solved)
Post by: Hans on Sat 17/02/2007 00:22:07
When my character walks through a door and goes to another room I want him to face a new direction. My problem is, that I don't know how to make the fade out "True". Now he is turning before the next room is loaded!
How do I solve this?
Title: Re: Problem with turning character
Post by: Scorpiorus on Sat 17/02/2007 02:56:33
Just move the "turning" script into Player enters room (before fade-in) of the second room:

player.FaceLocation( player.x + 10, player.y ); // player will face to the right
Title: Re: Problem with turning character
Post by: Hans on Sat 17/02/2007 08:05:57
Good idea. But there are more doors in that second room, so I am not sure wich one the character came through. Should I use global vars here?
Title: Re: Problem with turning character
Post by: strazer on Sat 17/02/2007 10:06:26
You can check which room the player came from:


// Player enters room 2 (before fadein)

if (player.PreviousRoom == 1) player.FaceLocation(player.x + 10, player.y);
else if (player.PreviousRoom == 3) player.FaceLocation(player.x, player.y + 10);
//...and so on
Title: Re: Problem with turning character
Post by: Hans on Sat 17/02/2007 10:30:19
Thank you.