I have a 4*4 grid. I have 16 MovieClips scattered around the grid. Each MovieClip is 40*40 and they are draggable. The user can drag and drop the MovieClips into the grid. Each clip has a correct position. For example for
clip 0 : x=0 , y=0
clip 1 : x=40, y=0
clip 2 : x=120 , y=0
clip 3 : x=160 , y=0
clip 15 : x=160 , y=160
The game finishes when all the clips are in correct position. So its easy to check for game over. Use a loop and ENTER_FRAME to monitor the positions of all clips.
There is a small problem I cannot solve. When the user drags a clip it will snap to position in the grid whether it is correct or not. The snappable positions will be multiples of 40 in this case. It is possible for two clips to snapped to a location and this has to be avoided. If I have put a clip at (40,120) I should not be able drop another MovieClip there. In effect I should be able to get some indication telling me that this position is occupied.
Using the indication I will make the MovieClip return to original position.
How can this can be achieved. The registration points of MovieClips are topleft.