Not sure how to handle multi touch
<p>I'm doing a simple game where the player draws shapes on the screen. The points of the path is stored in an array and drawn in the class GameLoop. I'm almost done, but now I realize that I should have done the game with multi touch input to allow two player to draw shapes at the same time! </p>

<p>I know that I need to use <code>event.Action_Down</code> for the first finger and <code>event.Action_Pointer_Down</code> for the next finger, but how do I handle the points of all shapes and the drawing of the path? Can I still just use one array, or do I need an array for each. It feels that I'm needing to double all code in my GameLoop class to check both path? My question might be a little bit unclear, but that how I feel right now! Some advice would be nice!</p>

<p>This is the code how I handle single touch events and pass all points to an array:</p>

<pre><code>@Override
public boolean onTouch(View v, MotionEvent event) {

    synchronized (gameLoop) {

        switch (event.getAction()) {

        case MotionEvent.ACTION_DOWN:
            gameLoop.touchDownX = event.getX();
            gameLoop.touchDownY = event.getY();
            break;

        case MotionEvent.ACTION_MOVE:
            Point point = new Point();
            point.x = (int) event.getX();
            point.y = (int) event.getY();
            gameLoop.addPoints(point);
            gameLoop.startDrawLine = true;
            break;

        case MotionEvent.ACTION_UP:
            Point point2 = new Point();
            point2.x = (int) gameLoop.touchDownX;
            point2.y = (int) gameLoop.touchDownY;
            gameLoop.addPoints(point2); // Add last point to close shape
            gameLoop.pathOK = true;
            gameLoop.touchActionUp = true;
            break;
        }
    }
    return true; 
}
</code></pre>

<p>EDIT:
This was complicated! I found some code that I have modified a little. I need to create an arrayList for each person that starts drawing a shape on the screen. There must be possible for several players to draw shapes at the same time. All Point values should be stored inside the <code>player</code> arrayList. Finally all <code>player</code>arrayList should be stored inside a main arrayList called <code>players</code>. Can I get some help to solve this? I don't know how to start.</p>

<p>I have declared my lists in the GameLoop class:</p>

<pre><code>        // Lists to handle multiple touch input
    players = new ArrayList&lt;List&lt;Point&gt;&gt;(); // Main arrayList
    player = new ArrayList&lt;Point&gt;(); // Inner arrayList
</code></pre>

<p>The code below is in the MainActivity class and I use an object of <code>GameLoop</code> like <code>gameLoop</code> to communicate with the GameLoop methods.</p>

<pre><code>@Override
public boolean onTouch(View v, MotionEvent event) {

    synchronized (gameLoop) {

    for(int i=0; i&lt;event.getPointerCount(); i++) { // Numbers of pointers on screen

        int id = event.getPointerId(i);

        // Check if fingers touch screen
        if (event.getActionIndex() == i &amp;&amp; (event.getActionMasked() == MotionEvent.ACTION_POINTER_UP || event.getActionMasked() == MotionEvent.ACTION_UP )) {


        }

        // Check if fingers leave the screen
        else if (event.getActionIndex() == i &amp;&amp; (event.getActionMasked() == MotionEvent.ACTION_POINTER_DOWN || event.getActionMasked() == MotionEvent.ACTION_DOWN)) {


        }

        // Check movement on screen
        else {

        }   
    }
    }
    return true; 
}
</code></pre>
