if your using a velocity value to move your ships (hopefully you are) you can simply modify the vector of the enemy ships to converge on the current location of the player ship. If the velocities are in controll of movement you simply adjust the acceleration vector (determined by position of player/enemy ships). For ai difficulties you could change the update time (how often enemy ship updates its vector) and the accuracy of the new acceleration vector(hindered by the introduction of some randomness to the calculated vector).
Heres some psuedo code
Code:
struct phys_movement {
x; y; [z;]// (position of sprite using movment physics) [optional]
vx; vy; [vz;]//(velocity added to xyz position each update)
ax, ay, [az;]//(acceleration vector that modifies velocity)
}
// in UPDATE function
if( getTickCount > lastTickValue * ai_difficulty ) /* how often does ai recalculate acceleration (based on difficulty) */
{
getPlayerPos( x, y [,z] );
Vector accelerateVec = getVectorToPlayerFromEnemy( ex, ey [,ez], x, y [,z] );
randDeviation = rand()%ai_difficulty
if( DecideWhichDirectionIsLargest ) { // find out largest part of vector
accelerateVec.x += randDeviation; // increase for inacurate
accelerateVec.y -= randDeviation; // decrease to compensate
}
/* you compensate for the additional random deviation to make sure your acceleration vector doesnt exceed the fastest you want the ships to be able to accelerate */
}
// update velocities of ships
ship.vx *= accelerationVec.x;
ship.vy *= accelerationVec.y;
if( shipMaxVelocity > MAGNITUDE( shipVelocityVector ) ) {
// clip the .vx, .vy values so they dont exceed maximum velocity
}
ship.x += ship.vx;
ship.y += ship.vy;
// etc.
I hope that was helpfu.