Stacking issues

Blitz3D Forums/Blitz3D Beginners Area/Stacking issues

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

First I want to thank Soja, Perturbatio and Wolron for their help. It got me pretty far down the road. Now I have a nagging issue with image "counter" stacking. I have counters moving all over the board and sometimes they stack up in one "32x32pixelsquare" 5 deep. As I mouse click each counter I cannot figure out how to control the stacking order so I can choose which counter to pick. here is the following brief example of a larger problem:
Global active.counter
Type Counter
   Field CounterX
   Field CounterY
   Field Stack Order
   inst.counter=counter
   For inst.counter= Each counter
    active.counter=inst.counter
	While
     If MouseX=active\counterX  And MouseY=active\counterY And inst\Stack Order <>0
	 active\stack Order=active\stack Order-1

	  "Process code for picked counter or"
	  "Process undo code to pick another counter"
	 
     EndIf
	Next
	Wend
	End
	
	Data counter1X counter1Y 1
           counter2x  counter2Y 2
		   counter3X counter3Y 3
		   counter4X counter4Y 4

Any takers out there. I have been struggling with this one for days and now I've had it!