I missed this post somehow. I believe that the drag and drop feature there does use the built in movement. However, direction is degrees (e.g. 0-359 practically if not technically) so you can't say direction == left or direction == right. If you want the direction in the 360 angle just use direction. However, if you want to know things like left or right, you could use a range where left is > 90 && < 270 and is everything else:
Code:
if (direction > 90) && (direction < 270) {
dir = left;
} else {
dir = right;
}
Note that 0 is equal to right not up. Alternatively, you can probably just say:
Code:
if (hspeed != 0) {
dir = sign(hspeed);
}