My question actually has several parts. First, I understand drag and drop behavior, but decided I didn't like it, so opted for setting the selected item with a "-picked" flag (red-picked=1, blue-picked=1, etc.) The first issue I have is, I used to standard programming, where I would just get a reference to the object clicked on, then on then check if the place to drop is a good spot and place it. In this environment, and for my situation, I'm having to repeat the same initial object selection for every single item (there are 4), and for each of the 4, I have to set ALL the "-picked" flags accordingly. I don't know if I can implement this with a group somehow to minimize the code. The point is, I only care that one of the items was selected, then move that item to the next spot that the mouse has selected. In summary, I managed so select an item by clicking and move it to the destination, but the code for working with 4 different objects seem like overkill and would like to optimize it if I could.
Next problem... what I'm creating is like the a game that I think was called, Master Mind. There would be a hidden combination of 4 color pegs. You have perhaps maybe 10 chances to guess the proper order of the colors. So, I have to check that all 4 colored sprites have been moved, then test for correctness, then allow them to be moved again if they were incorrect and they have turns left. The destination for the moves from one iteration to the next are simply a set of sprites, and these can me moved forward for the next move if the user fails to guess the correct order. And, I already know how to select->drop (as cluttered as that seems), but my bigger problem is, I'd like to leave the current colors at their current locations and place a spawned copy at the target location for the next move, so the user can see all there previous tries. This suggests some kind of spawn operation, but then the complication is, all of the older copies cannot be selectable! Do I restrict the click by Y, since each try moves vertically up the playing field, so only the sprites near the top can be moved (If mouse clicked -and- Mouse.Y > blahblah | set color's to picked flag)?
In the meantime, I'll keep trying alternatives, but any suggestions would be great! One thing I'm trying to wrap my head around is, if I spawn a bunch of red items, and they click on a red item, then how will it know which red one to move to the target location.... and thus this multiplied times 3 other colors involved.
BTW... I currently don't uses instance variables, but these might help, solve some of my code blot, by being able to implement my objects differently, and be able to loop through set of them and examine their instance variables, for values that would help me determine the processing that needs to be done, and help me identify the object to act upon.