A
Arj72
Guest
I am making a boss enemy in a platformer, where the enemy shoots off rockets and they follow the player. I want the sprite of the rocket to change depending on the direction it is going, but I have no clue how to. I tried this:
if vspeed > 0 while hspeed < 0
{sprite_index = Spr_RocketDownLeft}
else
if vspeed > 0 while hspeed > 0
{sprite_index = Spr_RocketDownRight}
else
if vspeed < 0 while hspeed < 0
{sprite_index = Spr_RocketUpLeft}
else
if vspeed < 0 while hspeed > 0
{sprite_index = Spr_RocketUpRight}
But the sprite doesn't change and if it does it stays like that forever. How can I make it change based upon the direction it is going?
if vspeed > 0 while hspeed < 0
{sprite_index = Spr_RocketDownLeft}
else
if vspeed > 0 while hspeed > 0
{sprite_index = Spr_RocketDownRight}
else
if vspeed < 0 while hspeed < 0
{sprite_index = Spr_RocketUpLeft}
else
if vspeed < 0 while hspeed > 0
{sprite_index = Spr_RocketUpRight}
But the sprite doesn't change and if it does it stays like that forever. How can I make it change based upon the direction it is going?