Ejemplo n.º 1
0
 public void highlightSequence() {
   isDisplaying = true;
   for (GameColour e : sequence) {
     switch (e.getColour()) {
       case 0: // RED - up
         ViewLogic.getInstance().selectUpwards();
         break;
       case 1: // BLUE - down
         ViewLogic.getInstance().selectDownwards();
         break;
       case 2: // GREEN - right
         ViewLogic.getInstance().selectRight();
         break;
       case 3: // YELLOW - left
         ViewLogic.getInstance().selectLeft();
         break;
     }
     try {
       Thread.sleep(500);
     } catch (InterruptedException e1) {
     }
     ViewLogic.getInstance().unhighlightAll();
     try {
       Thread.sleep(500);
     } catch (InterruptedException e1) {
     }
   }
   isDisplaying = false;
 }
Ejemplo n.º 2
0
 public boolean checkInput() {
   boolean isCorrect = false;
   if (ViewLogic.getInstance().getHighlighted().getGameColour().getColour()
       == sequence.get(currentPoint).getColour()) {
     isCorrect = true;
   }
   currentPoint++;
   currentPoint %= sequence.size();
   return isCorrect;
 }