First off, there is the issue that if you have three objects on-stage that are supposed to land on three different targets, how do you know which object the keyboard is controlling? But assuming you use the last one clicked or something like that... Basically, after each keypress, you're going to have to compare the location of some point on the currently selected object against the target point for that object and then essentially decide if it is "close enough" to be labelled a hit and snap it into place. I'm not super familiar with this part of the EaselJS library yet, so there may be an easier way, but essentially it will be a function like kbdHitTest( myObj, myTarg ) { var closeEnough = 6; if( (Math.abs(myObj.x - myTarg.x) <= closeEnough) && (Math.abs(myObj.y - myTarg.y) <= closeEnough) ) { myObj.x = myTarg.x; myObj.y = myTarg.y; } } Then, after the switch(e.keyCode) statement in your moveOne function, you'd call kbdHitTest( currentObj, currentTarg ); Hope that helps!
... View more