I dunno, something like this..?
make object sphere 2,.1
make object sphere 3,.2
make object cube 1,.5
move object down 1,.5
move object up 2,.8
move object left 2,.8
hide object 3
sync on
sync rate 60
do
if upkey() = 1
move object up 1, .1
endif
if downkey() = 1
move object down 1, .1
endif
if rightkey() = 1
move object right 1,.1
endif
if leftkey() = 1
move object left 1,.1
endif
if shiftkey() = 1
x#=object position x(1)
y#=object position y(1)
z#=object position z(1)
ox# = object position x(2)
oy#=object position y(2)
oz#=object position z(2)
osx# = object screen x(2)
osy# = object screen y(2)
position object 3,x#,y#,z#
point object 3, ox#,oy#,oz#
show object 3
global bullet=1
endif
if mouseclick() = 1
x#=object position x(1)
y#=object position y(1)
z#=object position z(1)
mx = mousex()
my = mousey()
fix object pivot 3
position object 3, x#,y#,z#
show object 3
global bullet=2
endif
if bullet = 1
gosub bulletfollowobject
endif
if bullet = 2
gosub bulletfollowmouse
endif
if object hit (2,3) then print "collision!"
if object collision(2,3) then print "collision"
sync:loop
bulletfollowobject:
if object screen x(3) <> osx#
move object 3,.1
endif
if object screen y(3) <> osy#
move object 3,.1
endif
if object collision (3,2)
bullet = 0
endif
return
bulletfollowmouse:
if object screen x(3) > mx
move object left 3,.1
endif
if object screen y(3) < my
move object down 3,.1
endif
if object screen x(3) < mx
move object right 3,.1
endif
if object screen y(3) > my
move object up 3,.1
endif
return
Guess it depends on if you want it to be 2d or 3d.. different approaches can be taken.
WindowsXP Home(Service pack 2), Athlon XP 2400+(2.1Ghz), 1GIG Ram, Ati Radeon 9800Pro 128MB.