AI are very complex things to create, there's no one way of doing it. Before we can help you we need to know exactly what it's capable of doing, what it's limits are, what it needs to do, and so on. It would be very difficult to give you an acceptable answer with just the instructions "it fights".
Offline
I suggest making a weak or 'low level' A.I. first. Just a little ai that doesn't know the controls very well, and moves around back and forth in a random order, and just hits random buttons so you have something to build up from. It will be much harder to make a more difficult A.I., because it'd have to be able to sense what the player's doing, and respond accordingly to it.
Offline