samedi 31 août 2019

how to stop if methode in animation timer [on hold]

How can i stop the if methode in animation timer after a few seconds? the if should start when p is at ten, but not stop when p is not ten anymore. it should stop after a period of seconds

          new AnimationTimer() {


                public void handle(long currentNanoTime) {

                    brick1.move();
                    brick2.move();
                    k.move();

                    if (p == 10) {
                        k2.move();
                    }

Aucun commentaire:

Enregistrer un commentaire