import android.graphics.Point;
import android.graphics.Rect;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;

public class Joy implements OnTouchListener{
 
 
 public float initx = 715;
 public float inity = 395;
 public Point _touchingPoint = new Point(715,395);
 public Point _pointerPosition ;
 public Boolean _dragging = false;
 public Boolean test = true;
 public int xplus,yplus;
 public int x1,y1,xp,yp;
@Override
 public boolean onTouch(View v, MotionEvent event) 
  {
  if (event.getPointerCount() > 1) 
  {
   x1 = (int)event.getX(1);
   y1 = (int)event.getY(1);
   _touchingPoint.x = (int)event.getX(0);
   _touchingPoint.y = (int)event.getY(0);
   
   update(event);}
  
  else {
   _touchingPoint.x = (int)event.getX(0);
   _touchingPoint.y = (int)event.getY(0);
//터치영역제한
   Rect asd=new Rect();
   asd.set(650,350,770,470);
    if(asd.contains(_touchingPoint.x, _touchingPoint.y) == true){
     update(event);
     }
  }
  
  
  return true;
  }
 
 public void update(MotionEvent event ){
  
  
  if ( event.getAction() == MotionEvent.ACTION_DOWN ){
   _dragging = true;
   test = true;
  }else if ( event.getAction() == MotionEvent.ACTION_MOVE){
   
   test =false;
  }else if ( event.getAction() == MotionEvent.ACTION_UP){
   _dragging = false;
   test =false;
  
  }
   if ( _dragging ){
     if( _touchingPoint.x < 690){
      _touchingPoint.x = 690;
     }if ( _touchingPoint.x > 740){
      _touchingPoint.x = 740;
     }if (_touchingPoint.y < 370){
      _touchingPoint.y = 370;
     }if ( _touchingPoint.y > 420){
      _touchingPoint.y = 420;
     }
     
     double angle = Math.atan2(_touchingPoint.y - inity,_touchingPoint.x - initx)/(Math.PI/180);
     
     _pointerPosition = new Point(xplus,yplus);
     _pointerPosition.y += Math.sin(angle*(Math.PI/180))*(_touchingPoint.x/70);
     _pointerPosition.x += Math.cos(angle*(Math.PI/180))*(_touchingPoint.x/70);
     xplus = _pointerPosition.x;
     yplus = _pointerPosition.y;
     xp = (int) (Math.sin(angle*(Math.PI/180))*(_touchingPoint.x/70));
     yp = (int) (Math.cos(angle*(Math.PI/180))*(_touchingPoint.x/70));
     
      }else if (!_dragging)
      {
       _touchingPoint.x = (int) initx;
       _touchingPoint.y = (int) inity;
     
      }
   }
  
 }
  


 

 

조이패드소스인데 터치순서에따라터치id가 0,1

로부여되는데 지금소스에는 처음터치한것만 인식이되는데(터치id0)

어떤방법을쓰는게가장좋을까요??