Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / DBpro Pick Sprite

Author
Message
loz
17
Years of Service
User Offline
Joined: 27th May 2006
Location:
Posted: 12th Feb 2009 20:13 Edited at: 12th Feb 2009 20:58
My version of pick sprite :mouse1 select :mouse2 de-select:
download images
Comments Please!

Rem Created: 11/02/2009 19:00:23

Rem ***** Main Source File *****
sync on
hide mouse
set image colorkey 255,0,255
load image "pick.bmp",101
load image "red.bmp",99
load image "blue.bmp",98
load image "pick2.bmp",102
sprite 99,300,140,99
size sprite 99,50,330
sprite 98,100,100,98
size sprite 98,130,145
pick = 0
do
mx = mousex()
my = mousey()
for s = 1 to 100
if sprite exist(s)
sx = sprite x(s)
sy = sprite y(s)
sw = sprite width(s)
sh = sprite height(s)
sprite 102,mx,my,101
text mx-50,my-50,"X "+ str$(mx) + " Y "+ str$(my)
psc = sprite collision(102,0)
if psc = s then text mx-20,my-20,"Sprite " + str$(s)
if psc = s and mouseclick() = 1 and pick = 0 then pick = s :position mouse sx,sy
if mouseclick() = 0 and pick = s then sprite pick,mx,my,s
if mouseclick() = 2 then pick = 0
endif
next
sync
loop

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-03-29 09:17:29
Your offset time is: 2024-03-29 09:17:29