Example #1
0
 /**
  * Move the shape on the X axes
  *
  * @param amX The amount to move on the X axes
  */
 public void moveShapeX(int amX) {
   for (TetrisBlock B : shapeBlocks) {
     B.setInt(0, B.getInt(0) + amX);
   }
 }
Example #2
0
 /** Set this shape at the top of the grid */
 public void setShapeTopGrid() {
   int YDist = getTopMostBlock().getInt(1);
   for (TetrisBlock B : shapeBlocks) {
     B.setInt(1, B.getInt(1) - YDist);
   }
 }
Example #3
0
 /**
  * Move a specific block in this shape
  *
  * @param Block the block to move
  * @param amX The amount to move on the X axes
  * @param amY The amount to move on the Y axes
  */
 protected void moveBlock(TetrisBlock block, int amX, int amY) {
   block.setInt(0, block.getInt(0) + amX);
   block.setInt(1, block.getInt(1) + amY);
 }
Example #4
0
 /**
  * Move the shape on the Y axes
  *
  * @param amY The amount ot move on the Y axes
  */
 public void moveShapeY(int amY) {
   for (TetrisBlock B : shapeBlocks) {
     B.setInt(1, B.getInt(1) + amY);
   }
 }