Sounds pretty straight forward you know the dimensions and coordinates of the room and its 100x100 so something along these lines maybe.
room=1
trigger=2
player=3
ghost=4
make object box room,100,.1,100
make object box trigger,10,1,10
make object cone player,2
make object box ghost,2,4,1
position object trigger,rnd(100),0,rnd(100)
position object room,50,0,50
color object room,rgb(255,0,0)
color object ghost,RGB(0,128,255)
hide object ghost
do
set camera to follow 0,object position x(player),0,object position z(player),object angle y(player),3,3,3,1
if returnkey()=1
position object trigger,rnd(100),0,rnd(100)
wait 10
endif
if upkey()=1
move object player,.01
endif
If downkey()=1
move object player,-.01
endif
rotate object player,0,object angle y(player)+mousemovex(),0
if object collision (player,trigger)=1
show object ghost
a=newzvalue(object position z(player),object angle y(player),10)
position object ghost,object position x(player) ,object position y(player) ,a
else
hide object ghost
endif
loop
crude but effective sorry its late ready for zzzzzzs lol
A child's dream never dies.