What kind of game is the A.I. for? Street Fighter, StarCraft, Doom, and Tetris Attack are all going to have significantly different A.I. I am guessing you could try having the enemy unit measure distance from the player. If they are in range attack once every few seconds. If not in range move toward them.