Exemplo n.º 1
0
  /**
   * Builds an immutable instance of the current configuration.
   *
   * @return An immutable {@link Title} with the currently configured settings
   */
  public Title build() {
    // If the title has no other properties and is either empty, just clears
    // or just resets we can return a special instance
    if (this.title == null
        && this.subtitle == null
        && this.fadeIn == null
        && this.stay == null
        && this.fadeOut == null) {
      if (this.clear) {
        if (!this.reset) {
          return Titles.clear();
        }
      } else if (this.reset) {
        return Titles.reset();
      } else {
        return Titles.of();
      }
    }

    return new Title(
        this.title, this.subtitle, this.fadeIn, this.stay, this.fadeOut, this.clear, this.reset);
  }
Exemplo n.º 2
0
  public void draw() { // NOPMD

    switch (phase) {
      case 0: // Show Starting SlidingBar.
        Logger.getInstance().debug("Case 0");
        if (starting.fadeIn(100, 0, 100, 0, 5, 0, 0)) {
          phase = 1;
        }
        textFont(fontCounter, 255);
        textSize(48);
        break;

      case 1: // Show Transition Effect.
        splayer.playSample(SamplePlayer.START_GAME + 2);

        if (createTransition(kare)) {
          phase = 2;
          changingLevel = false;
          kare = 0;
          trans = 250;
        }

        kare += 1;
        textFont(fontCounter, 255);
        textSize(48);
        break;

      case 2: // Show Actual Game Environment.
        if (redrawMorphome()) {
          counterValue[BLUE] = 0;
          counterValue[GREEN] = 0;
          phase = 3;
          changingLevel = true;
        }

        if (!changingLevel) {
          // draw gestures for both teams
          drawGestures();

          // draw gesture counter
          drawCounters();
        }

        break;

      case 3: // Make Everything White/Serene/Tranquil/Peaceful.
        eraser(255, 20);
        glow();
        unlockControls = false;
        if (thisInteractome.serene()) {
          phase = 4;
        }

        break;

      case 4: // Erase Everything for once.
        eraser(255, 255);
        phase = 5;
        break;

      case 5: // Show Ending SlidingBar. For Instance "http://finn.cti.gr"
        phase = 6;
        ending.fadeIn(50, 0, 10, (SCREENS - 1) * 50, 10, 10, 2);
        ending.reInitialize();
        break;

      case 6: // Uber Black Box.
        phase = 7;
        ending.fadeOut(50, 0, 0, 300, 30, teamWidth, 0, 0, 0, color(0, 0, 0), 1);
        ending.reInitialize();
        break;

      case 7: // Enwhiten.
        phase = 1;
        ending.fadeOut(25, 0, 0, 200, 10, teamWidth, 0, 0, 0, color(255, 255, 255), 1);
        createRandomness();
        thisInteractome = new Interactome(this, MAX_SIZE, MIN_SIZE, CIRCLE_COUNT, SCREENS, splayer);
        // initializeTitles(); //starting, ending
        kare = 0;
        trans = 0;
        break;

      default:
        break;
    }
  }