Anonymous
public text v1 · immutableonClipEvent(enterFrame)
{
if(this.hitTest(_root.shot))
{
this.gotoAndPlay("hit");
}
else
{
this.gotoAndStop("normal");
}
//move the manta
if(_root.mantaDirection == "right")
{
x = random(50)
if(this._x < 500)
{
this._x = this._x + x;
}
else
{
_root.mantaDirection = "left";
this._x = this._x - 50;
}
}
else
{
if(this._x > 50)
{
this._x = this._x - 30;
}
else
{
_root.mantaDirection = "right";
this._x = this._x + 10;
}
}
}