09-23-2014, 12:36 AM
Maybe you write it so if they are facing the enemy they turn the opposite direction and double tap that direction to run away. And if they are facing opposite direction they double tap that direction to keep running that way.
I made a script so the AI runs towards someone if they are a certain distance away.
It's pretty crap code cause I'm a crappy programmer
I made a script so the AI runs towards someone if they are a certain distance away.
Code:
//run after enemy
if (abs(self.x-target.x) > 450) {
if (self.x-target.x > 0){
left(1,0);
left(1,0);
}
else if (self.x-target.x < 0){
right(1,0);
right(1,0);
}
}
DBZ LF2 website
![[Image: wVUTOv1.png]](http://i.imgur.com/wVUTOv1.png)
DBZ LF2 v0.5.5 - Villain Update Trailer - September 25, 2024
DBZ LF2 mod v0.5.5 (January 1, 2025): Download
![[Image: wVUTOv1.png]](http://i.imgur.com/wVUTOv1.png)
DBZ LF2 v0.5.5 - Villain Update Trailer - September 25, 2024
DBZ LF2 mod v0.5.5 (January 1, 2025): Download