title: How to manage multiple events in a single method
body: <p>(This is probably more of a Java-question in general than an AndEngine-specific question, but I added both tags to be on the safe side)</p>
  
  <p>In AndEngine, touch events are catched by implementing IOnSceneTouchListener and then adding this method:</p>
  
  <pre><code>@Override
  public boolean onSceneTouchEvent(Scene scene, TouchEvent event) {
     ...
  }
  </code></pre>
  
  <p>Within this method, one can check for the events by testing <code>event.isActionUp()</code> (user has touched the screen), <code>event.isActionDown()</code> (user has released the screen) and <code>event.isActionMove()</code> (user is moving the touch).</p>
  
  <p>Currently I'm making a game where I need to be distinct of special cases, like <code>if (isActionDown() &amp;&amp; isActionMove())</code>, <code>if (userHasMoved &amp;&amp; isActionUp()</code> and the particular.</p>
  
  <p>My current code works, but is not very beautiful. Snippet of it:</p>
  
  <pre><code>if ( (!hubIsClicked) &amp;&amp; (!touchMoveIsDone) &amp;&amp; event.isActionDown()) {
    System.out.println("isActionDown, puzzlepiece");
    touchMoveIsDone = false;
    touchedBoardBlock = getBoardBlockFromPixelCoordinate(X, Y);
  } else if ( (!hubIsClicked) &amp;&amp; (!touchMoveIsDone) &amp;&amp; event.isActionMove()) {
    // Puzzle piece
    System.out.println("isActionMove, puzzlepiece");
    ..
  }
  </code></pre>
  
  <p>Here, <code>boolean hubIsClicked</code> and <code>boolean touchMoveIsDone</code> are global class variables. I don´t think this is a good way to flag for distinct cases, but it's the only way I know of since my Java-fu is not high enough.</p>
  
  <p>Question: I'm asking for how to make these checks better, perhaps by not using global variables at all. Is there a "the real Java way" to do this?</p>