Ah, yeah this makes sense. I've done something like this before with this code:
var dir = point_direction(x, y, mouse_x, mouse_y);
if (0 < dir and dir < 45 ) {
sprite_index = sprPlayerRight;
image_index = 0;
}
if (45 < dir and dir < 135 ) {
sprite_index = sprPlayerUp;
image_index = 0;
}
if (135 < dir and dir < 225 ) {
sprite_index = sprPlayerLeft;
image_index = 0;
}
if (225 < dir and dir < 315 ) {
sprite_index = sprPlayerDown;
image_index = 0;
}
if (315 < dir and dir < 0 ) {
sprite_index = sprPlayerRight;
image_index = 0;
}
}
So, basically just rehash this code but change the "dir" variable with "direction"? Sorry, I'm kinda new to programming lol
UPDATE: Yeah, this works exactly like I wanted it to. Thanks!