Make enemy follow hero only in 90 degrees (straight lines) ?
Hey ,
Im trying to make my enemy to follow my hero but restrict its movement only to up/down/left/right
meaning without diagonals movements ,
i managed to do this but its kinda choppy in its current status ,
Is there any template for this already ?
Or do you have an idea of how to make it?
Roy.
Im trying to make my enemy to follow my hero but restrict its movement only to up/down/left/right
meaning without diagonals movements ,
i managed to do this but its kinda choppy in its current status ,
Is there any template for this already ?
Or do you have an idea of how to make it?
Roy.
Comments
The thing is that the hero is constantly moving so the enemy will always try to reach for its Y...
Roy
That's why I'm asking to see if there is a different method ..
Man those "simple" things are hard...
Roy.
Rule when Actor receives an event overlaps or collides with actor type enemy
changeAttibute self.Position.X to self.Position.X-20
changeAttibute self.Position.Y to self.Position.Y-20
MH
But i don't see what you are trying to do , if 2 enemies with the above rule will collide , both of them will go 20 pixels down and left , am i missing something?
Roy.
what will happen is they will veer away from each other...
(probably at an angle unless you timer-delay (after 0.01 seconds) the Y (or X) changeAttribute)
the change X or Y on collision will keep them from looking like one...
MH