hiyar, well its been two months and my game has come along in leaps and bounds until now, i had a basic ai system ready but i seem to have alot of faults with it.
1.)The enemies can go through walls
The enemies can walk straight through walls and basicly i have no idea how to stop them doing that
2.)The enemies dont attack
I tried adding a hittest inside it to play an arm symbol and it will not attack the character
3.)For it to work things must be a certain way
The code means that the character must be in the exact center of the map
i was wondering if anyone could fix any of these problems for me
thank you in advance
Could anybody help me please?
BY the way, I got an unexpected file format error here…
[LEFT]The file format is flash cs3. i only need one or two of thouse problems fixed, i created alot of other things for the game im making but so far only ai is not working for me, now i have got the enemies walking but they still wont attack, i cant creat a hittest that works for it.[/LEFT]
i also use flash8, and i dont plan on using cs3 anytime soon, instead i will move on to something like flashdevelop which is meant for coding alone…
Anyway, mordormaster, if the code is in as2, then convert the file to fl8 and show, else put your code right here.
i have converted it to flash 8 format now, but incase that dont work here is the code for the ai itself 
onClipEvent (enterFrame) {
var herox=(_root.map._width/2)-_root.map._x;
var heroy=(_root.map._height/2)-_root.map._y;
// determine the distance using pythag’s theorem
dist = Math.sqrt( Math.pow( this._x - herox, 2) + Math.pow( this._y - heroy, 2) );
// only chase if within 200px, and stop if touching
if(dist < 200 && dist > this._width){
// determine the angle between the hero and the enemy
angle = Math.atan2( heroy - this._y, herox - this._x );
// rotate enemy to face the hero
this._rotation = angle * (180 / Math.PI);
// move the enemy along the vector that leads to the hero
// adjust the value of 5 to change the speed
this._x += Math.cos(angle) * 5;
this._y += Math.sin(angle) * 5;
}else{
// normal enemy movement when not chasing goes here
} //if
}
right i have fixed the walking through walls and made it attack but i need to be able to make it go for the center of the screen, so far if i make my map any bigger than 700 pixels by 700 pixels it just wont work, can anyone help me?