OOP-Projects-Java

Log | Files | Refs | README

O_Block.java (570B)


      1 package blocks;
      2 
      3 import java.awt.Color;
      4 
      5 public class O_Block extends Poly {
      6 	// holds the information that dictates what shape the object becomes on the
      7 	// board
      8 	public int[][] Shape = { { 1, 1 }, { 1, 1 }, };
      9 
     10 	public O_Block(int x, int y) {
     11 		super(x, y);
     12 		super.setColor(Color.yellow);
     13 	}
     14 
     15 	@Override
     16 	public int[][] getShape() {
     17 		// TODO Auto-generated method stub
     18 		return Shape;
     19 	}
     20 
     21 	@Override
     22 	public void rotateRight() {
     23 		Shape = super.rotateClockwise(Shape);
     24 	}
     25 	
     26 	@Override
     27 	public void rotateLeft() {
     28 		Shape = super.rotateCounterClockwise(Shape);
     29 	}
     30 }