I did it like this:
1)I made an active object and set its x and y always to the positions of mouse pointer x and y
2)when user cliks left button and my active object is overlapping the oject that I would like to pick then set counter 1
3)when counter is 1, then set the position of the pickable object (0,0) from the picking up object
4)When the user cliks right button, set counter to 0
The last one could be done with left button too, then you need to use another counter..
That was my 1st time to help someone in this forum..I hope I did everything right..
Edited by the Author.
I33´t lover, baby there´s no other...
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
12th August, 2003 at 03:22:00 -
Theres a less complex way:
User clicks on active - toggle flag 0
if flag 0 = on, always set active.x,y to mouse.x,y
Not quite. you need a flag (a counter) saying if the mouse is occupied or not. otherwise you could pick up more than one object at once
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
13th August, 2003 at 02:26:18 -
Would it work if you said:
Only one action while event loops?