0

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?

이현우
  • 1
  • 1
  • 1
    Please provide example code in your question. What form are you refering too? –  Nov 12 '15 at 01:02

1 Answers1

0

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;
}
Rob
  • 4,927
  • 4
  • 26
  • 41