pixeltroid
Member
This very very basic code I have changes the enemy's sprite direction when the hero runs past him.
if (x<obj_hero.x) {
image_xscale = -1;
} else {
image_xscale = 1;
}
The sprite flip happens a instantly which is fine for some enemies. But I have some other enemies that I'd need to flip after a slight delay (basically give the hero 2 seconds to run away).
How should I go about implementing this?
Any help would be appreciated.
if (x<obj_hero.x) {
image_xscale = -1;
} else {
image_xscale = 1;
}
The sprite flip happens a instantly which is fine for some enemies. But I have some other enemies that I'd need to flip after a slight delay (basically give the hero 2 seconds to run away).
How should I go about implementing this?
Any help would be appreciated.