OOP-Projects-Java

Log | Files | Refs | README

J_Block.java (578B)


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