Avoiding maths, this is one of doing this:
sync on
sync rate 65
hide mouse
`player controled object (green triangle)
make object triangle 1, 0,0,20, 20,0,-20, -20,0,-20
position object 1, 500,0,500
color object 1, rgb(0,255,0)
`enemy object (red triangle)
make object triangle 2, 0,0,20, 20,0,-20, -20,0,-20
color object 2, rgb(255,0,0)
`main loop
do
`player controls
if upkey() = 1 then move object 1, 3
if downkey() = 1 then move object 1, -3
if leftkey() = 1 then turn object left 1, 2
if rightkey() = 1 then turn object right 1, 2
`respawn enemy
if spacekey() = 1
`position enemy object on top of player object
position object 2, object position x(1),object position y(1),object position z(1)
`rotate the enemy object to the same orientation as the player object
rotate object 2, object angle x(1),object angle y(1),object angle z(1)
`move the enemy object 300 units from the player object
move object 2, 300
`point the enemy object at the player (or you could rotate it how you want)
point object 2, object position x(1),object position y(1),object position z(1)
endif
position camera 500,1000,500
point camera 500,0,500
set cursor 0,0
print "Use arrow keys to move green triangle"
print "Press space key to respawn enemy (red triangle)"
sync
loop
end