Makkeonmies
Member
Hey,
basically, I want to make it so that if an enemy object with a certain variable (effect) set to 1 comes near enough to another enemy object whose var is still 0, then that enemy object's var 'effect' also becomes 1. Sort of that the effect spreads to all nearby enemies from each other.
I have this in enemy-object's Step:
Somethings wrong here tho, can't figure out what. Ive tried altering it slightly, but to no avail...
basically, I want to make it so that if an enemy object with a certain variable (effect) set to 1 comes near enough to another enemy object whose var is still 0, then that enemy object's var 'effect' also becomes 1. Sort of that the effect spreads to all nearby enemies from each other.
I have this in enemy-object's Step:
GML:
if effect = 0{
if distance_to_object(instance_nearest(x,y,enemypar)) < 64{
with instance_nearest(x,y,enemypar)
{
if effect = 1
{
self.spd -=1;
self.effect = 1;
}
}
}
}