I
iScream
Guest
So I want to make a sprite change based on mouse_x and mouse_y , so when mouse_x is less than object's x, then the sprite changes to this one which is turned left, and the same thing with y value. I have this line of code:
if (x < mouse_x) sprite_index = spr_playerR;
if (x > mouse_x) sprite_index = spr_playerL;
which works fine, but I don't know how to make that sprite changes in x and y at the same time. I tried
if (y < mouse_y) sprite_index = spr_playerD;
if (y > mouse_y) sprite_index = spr_playerU;
But it glitches :/
(R=right, L=left, etc...)
What commands should I use?
I am sooo novice, so I need an explanation.
if (x < mouse_x) sprite_index = spr_playerR;
if (x > mouse_x) sprite_index = spr_playerL;
which works fine, but I don't know how to make that sprite changes in x and y at the same time. I tried
if (y < mouse_y) sprite_index = spr_playerD;
if (y > mouse_y) sprite_index = spr_playerU;
But it glitches :/
(R=right, L=left, etc...)
What commands should I use?
I am sooo novice, so I need an explanation.