Hi guys, I'm just making a really basic AI that goes back between left and right, however when I'm using this code...
Create:
dir=choose(-1,1) alarm[1]=30;
Alarm 1:
if dir=-1
{
dir=1
alarm[1]=30;
}
if dir=1
{
dir=-1
alarm[1]=30;
}
Step:
if dir=-1
{
hspeed+=0.4
}
if dir=1
{
hspeed-=0.4
}
if hspeed>3
{
hspeed=3
}
if hspeed<-3
{
hspeed=-3
}
... It doesn't work properly. It just keeps going right. Some of the ones that start left curve back into right, but then it just keeps going off to the right.
Any solutions?
EDIT: Reformatted post.



Find content
Not Telling
