How do I make an actor run away from another?
Hi! Before I improvide my way out of it, I was wondering if there was a way to make one actor "run away" from another, as on opposite of (move to).
I think I saw something similair in templates where you drag and shoot an object (like angry birds) though I might be mistaken.
In any case, Thank you in advance!:)
I think I saw something similair in templates where you drag and shoot an object (like angry birds) though I might be mistaken.
In any case, Thank you in advance!:)
Comments
Instead of using moveto, its probably easier to use move.
To get an actor to move _toward_ something (like the mouse in the following case) use Move:
Direction: vectorToAngle( game.Mouse.Position.X - self.Position.X , game.Mouse.Position.Y - self.Position.Y )
To get an actor to run _away_ from something use Move:
Direction: vectorToAngle( self.Position.X - game.Mouse.Position.X , self.Position.Y - game.Mouse.Position.Y )
Of course, you would substitute in the other actor's positions where it now says mouse position.
Hope this helps,
RThurman
-dimok
RThurman