Problem with turning character (Solved)

Started by Hans, Sat 17/02/2007 00:22:07

Previous topic - Next topic

Hans

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?

Scorpiorus

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

Hans

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?

strazer

You can check which room the player came from:

Code: ags

// 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

Hans


SMF spam blocked by CleanTalk