/*
   * cambia la dificultad cada cierto tiempo (maximo nivel = 5)
   */
  public int cambioDific() {
    // System.out.println(time.millisElapsed());

    if (time.millisElapsed() >= 30000 && nivelActual == 1) {
      varDific = 250;
      contLV.setValue(2);
      nivelActual = 2;
      velExtra = 1;
    } else if (time.millisElapsed() >= 50000 && nivelActual == 2) {
      varDific = 100;
      contLV.setValue(3);
      nivelActual = 3;
      velExtra = 2;
    } else if (time.millisElapsed() >= 100000 && nivelActual == 3) {
      varDific = 70;
      contLV.setValue(4);
      nivelActual = 4;
      // velExtra=2;
    } else if (time.millisElapsed() >= 150000 && nivelActual == 4) {
      varDific = 50;
      contLV.setValue(5);
      nivelActual = 5;
      if (velExtra < 3) velExtra = 3;
    }
    return (varDific);
  }
  /*
   * crea los contadores, mensajes, personaje y tiempos del juego
   */
  public void creanivel() {
    time = new SimpleTimer();
    time.mark();
    Barr = new Barra();
    sound2.stop();
    bandBarra = 0;
    varDific = 450;
    nivelActual = 1;
    velExtra = 0;

    orbPj = new Orb();
    addObject(orbPj, 390, 463);

    addObject(new Mensaje("Nivel"), 623, 93);
    addObject(new Mensaje("Vida"), 623, 151);
    addObject(new Mensaje("Tiempo"), 623, 31);
    addObject(new Mensaje("Color seleccionado"), 687, 439);

    contLV = new Counter();
    addObject(contLV, 686, 92);
    contLV.setValue(1);

    contHP = new Counter();
    addObject(contHP, 686, 150);
    contHP.setValue(orbPj.getHP());

    contTime = new Counter();
    addObject(contTime, 686, 30);

    muestraColor = new acColor();
    addObject(muestraColor, 691, 497);

    sound.playLoop();
  }
예제 #3
0
 private void notifyFocused(DialogWrapper wrapper) {
   myFocusedCallback.setDone();
   final long timeout = wrapper.getTypeAheadTimeoutMs();
   if (timeout > 0) {
     SimpleTimer.getInstance()
         .setUp(
             new EdtRunnable() {
               @Override
               public void runEdt() {
                 myTypeAheadDone.setDone();
               }
             },
             timeout);
   }
 }
 /*
  * cuenta el tiempo se juego en segundos
  */
 public void tiempo() {
   tiempoActual = time.millisElapsed() / 1000;
   contTime.setValue(tiempoActual);
 }