示例#1
0
 @Override
 public void activate() {
   initGl();
   missionText =
       computeTextDisplay(
           game.getGraphics(),
           missionLine.getText(),
           50,
           200,
           800,
           40,
           AliteColors.get().mainText(),
           Assets.regularFont,
           false);
   targetDeltaX =
       Math.random() < 0.5
           ? (float) Math.random() * 2.0f + 2.0f
           : -(float) Math.random() * 2.0f - 2.0f;
   targetDeltaY =
       Math.random() < 0.5
           ? (float) Math.random() * 2.0f + 2.0f
           : -(float) Math.random() * 2.0f - 2.0f;
   targetDeltaZ =
       Math.random() < 0.5
           ? (float) Math.random() * 2.0f + 2.0f
           : -(float) Math.random() * 2.0f - 2.0f;
   lastChangeTime = System.nanoTime();
 }
  @Override
  public void present(float deltaTime) {
    if (disposed) {
      return;
    }
    Graphics g = game.getGraphics();
    g.clear(AliteColors.get().background());

    displayTitle("Gameplay Options");
    difficultyLevel.render(g);
    String text = getDifficultyDescription();
    centerText(text, 315, Assets.regularFont, AliteColors.get().mainText());
    autoId.render(g);
    dockingSpeed.render(g);
    laserAutoFire.render(g);
    keyboardLayout.render(g);

    back.render(g);
  }
示例#3
0
  @Override
  public void present(float deltaTime) {
    Graphics g = game.getGraphics();
    g.clear(AliteColors.get().background());
    displayTitle("Mission #4 - Destroy the Hostile Ship");

    if (missionText != null) {
      displayText(g, missionText);
    }

    if (cougar != null) {
      displayShip();
    } else {
      Rect visibleArea = ((AndroidGraphics) game.getGraphics()).getVisibleArea();
      setUpForDisplay(visibleArea);
    }
  }
示例#4
0
  @Override
  public void present(float deltaTime) {
    if (disposed) {
      return;
    }
    Graphics g = game.getGraphics();
    g.clear(AliteColors.get().background());
    displayWideTitle("Hacker v2.0");

    for (int i = 0; i < 16; i++) {
      String hex = String.format("%02X", i);
      g.drawText(
          hex, 20 + offset * (i + 1), 140, AliteColors.get().additionalText(), Assets.titleFont);
    }

    if (deltaY != 0) {
      deltaY += deltaY > 0 ? -1 : 1;
      yPosition -= deltaY;
      if (yPosition < 0) {
        yPosition = 0;
      }
      if (yPosition > maxY) {
        yPosition = maxY;
      }
    }

    g.setClip(0, 60, -1, 930);
    for (int i = 0; i < 16; i++) {
      String hex = String.format("%X0", i);
      int y = 140 - yPosition + 80 * (i + 1);
      g.drawText(hex, 20, y, AliteColors.get().additionalText(), Assets.titleFont);
    }
    int count = 0;
    for (Button b : values) {
      b.setYOffset(-yPosition);
      long color =
          b.isSelected()
              ? AliteColors.get().baseInformation()
              : ((count / 16) + (count % 16)) % 2 == 0
                  ? AliteColors.get().informationText()
                  : AliteColors.get().mainText();
      b.setTextColor(color);
      b.render(g);
      count++;
    }
    g.setClip(-1, -1, -1, -1);

    done.render(g);
  }