Ah, I see. Well, just go at it step by step. We'll need the position of the click in relation to the player, so store that in two global ints:
// inside on_mouse_click
mouse_offset_x = mouse.x - (player.x - GetViewportX());
mouse_offset_y = mouse.y - (player.y - GetViewportY());
The next thing is very similar to the mouse cursor stuff:
// above rep_ex
bool was_moving;
// inside rep_ex
if (!player.Moving && was_moving) {
int l == player.Loop;
if (l == 0) { if (mouse_offset_x < 0) l = 6; else l = 4; }
if (l == 1) { if (mouse_offset_y < 0) l = 7; else l = 6; }
if (l == 2) { if (mouse_offset_y < 0) l = 5; else l = 4; }
if (l == 3) { if (mouse_offset_x < 0) l = 7; else l = 5; }
player.Loop = l;
}
was_moving = player.Moving;
To make a custom room transition: you can't like add your own to the existing ones and have it be called automatically. Again, think about this step by step: The room is supposed to fade out when the character leaves the room, and supposed to fade in after they got to a new room and the before fadein events have run.
The obvious place for the first part is on_event/eEventLeaveRoom. What you do is turn on a GUI with a transparent DynamicSprite as background, then in a loop, change the sprite and set it as GUI background until the GUI is all black. Then the room change occurs, with the transition set to "instant".
Now you need a way to figure out that a room change occured. Conveniently, rep_ex isn't executed during the before fadein event, so again, we're back at checking a variable inside it. This time we store player.Room at the end, then check
if (player.Room != last_room). If that's true, set
last_room to
player.Room and start changing the DynamicSprite back to a transparent one.
In theory you don't even need to turn off the GUI if it is set to not clickable.