Ok, got it doing a bit more of what I was thinking, now to reset the above post.
Rem Project: mouse2
Rem Created: 8/1/2005 5:33:29 PM
Rem ***** Main Source File *****
Rem Project: randommouse
Rem Created: 7/31/2005 2:17:36 PM
Rem ***** Main Source File *****
rem Standard Setup Code
sync on : sync rate 0 :
backdrop on
color backdrop rgb(0,0,0)
hide mouse
set text font "arial" : set text size 12 : set text transparent
rem make cross and grab it
line 0,4,9,4
line 4,0,4,9
get image 1,0,0,9,9,1
sprite 1,0,0,1
rem hide sprite 1
cls
circle 4,4,4
get image 2,0,0,9,9,1
sprite 2,0,0,2
rem hide sprite 2
cls
hit=0
sw#=rnd(screen width()/2)
sh#=rnd(screen height()/2)
do
`Return Integer=SPRITE COLLISION(Sprite Number, Target Sprite Number)
`Return Integer=SPRITE HIT(Sprite Number, Target Sprite Number)
rem
mx#=mousex()
my#=mousey()
oldmx#=mx#
oldmy#=my#
sprite 1,my#,mx#,1
text 0,0,"Sprite Hit(1,0)="+str$(sprite hit(1,0))+" "+"Sprite Hit(2,0)="+str$(sprite hit(2,0))
text 0,10,"Sprite Hit(1,2)="+str$(sprite hit(1,2))+" "+"Sprite Hit(2,1)="+str$(sprite hit(2,1))
text 0,20,"sprite collision(1,0)="+str$(sprite collision(1,0))+" "+"sprite collision(2,0)="+str$(sprite collision(2,0))
text 0,30,"sprite collision(1,2)="+str$(sprite collision(1,2))+" "+"sprite collision(2,1)="+str$(sprite collision(2,1))
if mx#<>oldmx#
if mx#<oldmx#
sprite 1,my#,mx#,1
else
if mx#>oldmx#
sprite 1,my#,mx#,1
endif
endif
endif
if my#<>oldmy#
if my#<oldmy#
sprite 1,mx#,my#,1
else
if my#>oldmy#
sprite 1,mx#,my#,1
endif
endif
endif
if sprite collision(1,0)=2 or spacekey()=1
sw#=rnd(screen width())
sh#=rnd(screen height())
sprite 2,sw#,sh#,2
else
sprite 2,sw#,sh#,2
endif
sync
loop
Now to work on random direction,if you start going in the same direction for more than a few pixels it will take another direction.
In other words there will be no way you will be able to control it.
I'm not getting you down am I, Ho Look! another fancy Door?