Game Development Reference
return a value.
Figure 10-3. dropTarget returns only a reference to the
object that mouse is directly over.
Because of this limitation, you might find yourself using `nklP]ncap infrequently, and it might be little
or no use at all for sophisticated drag-and-drop games. Instead, you might want to consider using
depPaopK^fa_p to find the names of the objects that the drag object is passing over. This will be a bit
more work to set up because you need to store the names of all possible targets in an array and loop
through each frame to check whether they're colliding with the drag object. You don't quite have the
skills to do this yet, but you will by the end of this chapter.
Snapping the object to the target
The code that actually snaps the drag objects to their targets sits in an AJPAN[BN=IA event handler: