well im not sure if this is enough to be called an a.i but what im trying to do is getting a code that home in on a player and hopefully that code can be used on a missile or some sort >.< but because the way the code works it bounces like a ball which i think itโs not good for a missile to move like that
im trying to use Point but it compiles error saying it cannot load the class
iโm kinda noob in programming ^_^" so can anyone lend me a help and suggest me with a better way of making something like this?
here is what i can come out with
all it can do is to track X and Y then either + or - them
tracker.onEnterFrame = function() {
// getting positions
var myY = tracker._y
var playerY = _root.my._y
var myX = tracker._x
var playerX = _root.my._x
if (myY != playerY){
if(myY > playerY){
this._y -= 20
trace("-y")
}else if (myY < playerY){
this._y += 20
trace("+y")
}
}
if (myX != playerX){
if(myX > playerX){
this._x -= 20
trace("-x")
}else if (myX < playerX){
this._x += 20
trace("+x")
}
}
};