PlayerOne
Member
Can't tell you how many times I've read this over and over again but for some reason it wont work; It's rather straight forward. Looking to change the sprite based on the direction its moving.
Why wont this snippet of code change the sprite when moving?
Code:
switch(point_direction(xprevious,yprevious,x,y))
{
case 0: sprite_index=sPlayerRight_Outfit0; shooting=0; break;
case 90: sprite_index=sPlayerUp_Outfit0; shooting=90; break;
case 180: sprite_index=sPlayerLeft_Outfit0; shooting=180; break;
case 270: sprite_index=sPlayerDown_Outfit0; shooting=270; break;
case 225: sprite_index=sPlayerDownLeft_Outfit0; shooting=225; break;
case 135: sprite_index=sPlayerUpLeft_Outfit0; shooting=135; break;
case 315: sprite_index=sPlayerDownright_Outfit0; shooting=315; break;
case 45: sprite_index=sPlayerUpRight_Outfit0; shooting=45; break;
default: sprite_index=sFire_VeryBig; shooting=360 break;
}