There are 4sprite that show left,right,up,down and i made movement used gridpath movement so i want to make like this
if playerobject go left, change spr_left
How to make it in gridpath?
There are 4sprite that show left,right,up,down and i made movement used gridpath movement so i want to make like this
if playerobject go left, change spr_left
How to make it in gridpath?
You will have to check out what the last direction of the player was;
if (x < xprevious) {
sprite_index = spr_right;
}
if (x > xprevious) {
sprite_index = spr_left;
}
if (y < yprevious) {
sprite_index = spr_up;
}
if (y > yprevious) {
sprite_index = spr_down;
}