Esempio n. 1
0
    public void start() {
      if (paused) return;

      started = true;
      finishedFalling = false;
      turnAmount = 0;
      score = 0;
      clearBoard();

      makeNewPiece();
      timer.start();
      timer1.start();
    }
Esempio n. 2
0
    public Board() {
      setFocusable(true);
      randNum = (int) (Math.random() * 7);
      currentX = new int[4];
      currentY = new int[4];
      shadowX = new int[4];
      shadowY = new int[4];
      tempY = new int[] {0, 0, 0, 0};
      staticX = new ArrayList<Integer>();
      staticY = new ArrayList<Integer>();
      rushX = new ArrayList<Integer>();
      rushY = new ArrayList<Integer>();
      timer = new Timer(1000, this);
      timer1 = new Timer(1000, this);
      timer2 = new Timer(1000, this);
      timer2.start();
      clearBoard();

      addKeyListener(this);
      addFocusListener(this);
      addMouseListener(this);
    }