well, you've got 2 ways to make your sprite move towards a target.. and depending on the complexity of the maze, you can either do one or the other to different levels of success..


1. Pacman style AI.
Basic rule based AI. Makes decisions at junctions towards or away from player (depending on whether the player has eaten a pill or not) if the AI hits a corner he goes in the direction of the corner, but not back on himself unless he hits a dead end.

2. A* style algorithm...
Quite complicated, best designed for maze style games where getting lost in the maze would look stupid. It finds the shortest route possible based on the parameters it's given.. it can handle hills and other obstacles and can find the shortest path or the least expensive path. Uses a bit more processing power though. There is an example on this site for A*, there are also loads, bucket loads, monsoons of examples on the net about it.

I think your game needs a version of #1


The most simple AI in the world is

if enemyx<playerX then enemyX++
if enemyx > playerx then enemyx--

etc..