title: Stuck while making tetris
body: <p>I am trying to make my own version of the Tetris game. So far, I am able to show pieces, rotate them. But I am stuck at a point and not sure how to proceed.</p>
  
  <p><img src="https://i.stack.imgur.com/1ADtZ.png" alt="enter image description here"></p>
  
  <p>I have a</p>
  
  <ul>
  <li><code>BoardClass</code> with static integer array <code>board</code> for the grid. With different integer numbers I am showing different colors.</li>
  <li><code>Block</code> class which has methods to generate random blocks and rotate them.</li>
  <li>A <code>Graphic</code> class which display colors based on the <code>board</code> array, and</li>
  <li>A <code>GameLogic</code> class for starting, pausing game.</li>
  </ul>
  
  <p>For current piece I have taken a 4x4 array and is placed onto the board in first four rows of <code>board</code></p>
  
  <p>All works good. But how do I start moving things. How to establish a relation between blocks is where I am stuck.</p>
  
  <p>My problems</p>
  
  <ul>
  <li>Am I working on right track?</li>
  <li>How to automate things, I mean, how will the blocks appear automatically one after another. I know I can have a DispatcherTimer and move block at tick event but drawing and redrawing the complete grid is slow. I want only the portion of the game grid to be redrawn.</li>
  <li>If I move my piece left/right/down the complete piece array would move and this would mean a 4x4 piece moving and not just the piece which may be in 1x3 or 2x2.</li>
  <li>How to know if the piece is new or an old settled piece. I know I can take a boolean value but I think a boolean array of 10x20 would be large.</li>
  </ul>
  
  <p>I know these might not be good question to ask on SO but am stuck and any help would be appreciated. And ask me if you want to see any piece of code.</p>