One More time I knew that was too much code IanM
Rem Project: DragSprite
Rem Created: 10/22/2003 7:15:07 AM
Rem ***** Main Source File *****
Randomize Timer()
For i = 1 to rnd(15)+5
X = Rnd(Screen width()/3)
Y = Rnd(Screen Height()/3)
ink rgb (rnd(255),rnd(255),rnd(255)),0
cls
box 0,0,x,y
get image i,0,0,x,y
sprite i,Rnd(Screen width()),Rnd(Screen height()),i
next i
Target = 998
do
if mouseclick() = 1
if target <> 0 and Pick_Sprite(Target)= 1
sprite target, Mousex()-(sprite width(target)/2),MouseY()-(sprite height(target)/2),target
else
Target = Pick_Sprite(0)
if Target <> 0
sprite target, Mousex()-(sprite width(target)/2),MouseY()-(sprite height(target)/2),target
endif
endif
endif
sync
loop
Function Pick_Sprite(Target)
rem change 999 to any number you wish
rem move the next line outside of main loop should only be called once
get image 999,1,1,2,2
sprite 999,mousex(),Mousey(),999
hit = sprite collision(999,Target)
rem the following is only for testing
set cursor mousex()-200,Mousey()
print "Hit Sprite # : ",hit
delete sprite 999
EndFunction hit
I can't stand too much code
System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX