When trying to implement different directions for my player to face when moving in different directions, the direction my character is facing seems to be opposite of the direction it is moving in when actually testing it, and I was wondering if someone could poit out my mistake.
Here is the code I have:
//move the player
x += xspd;
y += yspd;
//set sprite
if xspd > 0 {face = RIGHT};
if xspd < 0 {face = LEFT};
if yspd > 0 {face = DOWN};
if yspd < 0 {face = UP};
sprite_index = sprite[face];
And then:
sprite[RIGHT] = spr_player_right;
sprite[UP] = spr_player_up;
sprite[LEFT] = spr_player_left;
sprite[DOWN] = spr_player_down;
face = DOWN;