如何拖动和移动一个物体,即使没有触碰物体但没有传送物体,现在当我触摸屏幕上的另一个地方时,玩家只是传送到我触摸的地方。
playerPoint.set(x,y)` >> is to set the player location x and y
@Override
public boolean onTouchEvent (MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_MOVE:
playerPoint.set((int)event.getX(), (int)event.getY());
}
return true;
//return super.onTouchEvent(event);
}