A maze can be tricky depending on how you are building it. You could use A* (a star) path finding to have the computer find the path to the player. Or, depending on how you built the maze, you could use the maze algorithm to find the path to the player.
If the maze is simple - there are a lot of paths through it or there are very few dead ends, you can use some very basic AI where the computer "looks" at where the player is (in terms of X and Z - assuming that they don't move upward or downward).
This is a 2d example. Think of it as an overhead look at a 3d environment. Move the blue square around with the arrow keys. The red square will always try to follow the blue square just by adjusting it's x and y position to match the blue square. In 3d, you might replace the code for adjusting the y direction for code adjusting the Z direction. The principal is the same. In your maze, you would have collision detection to keep objects from moving through walls:
set display mode 800,600,32
sync on
sync rate 60
hide mouse
gosub _init
do
cls
gosub _move_blue_square
gosub _move_red_square
sync
loop
_init:
rem make a blue square
cls 255
get image 1,0,0,64,64
sync
rem set intial position of blue square to the middle of the screen
bluex=screen width()/2
bluey=screen height()/2
rem make a red square
cls rgb(255,0,0)
get image 2,0,0,64,64
sync
rem set the red square to the top left corner
redx=0
redy=0
rem clear screen to black
cls 0
return
_move_blue_square:
rem use cursor (arrow) keys to move the blue square
inc bluex,(rightkey()-leftkey())*2
dec bluey,(upkey()-downkey())*2
paste image 1,bluex,bluey
return
_move_red_square:
rem based on blue squares screen position, change reds
if redx < bluex
inc redx
endif
if redx > bluex
dec redx
endif
if redy > bluey
dec redy
endif
if redy < bluey
inc redy
endif
rem position the red square
paste image 2,redx,redy
return
There's even a simpler method in 3d where you use POINT OBJECT to point the computer object at the player, and then use MOVE OBJECT to move the comp towards the player.
_move_computer_towards_player:
rem psuedo variables comp=computer object play=player object
rem players position
px#=object position x(play)
py#=object position y(play)
pz#=object position z(play)
rem we want to keep the computer at it's current level so we'll
rem use it's own y height
cy#=object position y(comp)
point object comp,px#,cy#,pz#
move object comp,speed#
rem check for collision
if collision with wall
do something - reposition comp etc.
return
Enjoy your day.