vendredi 10 janvier 2020

Setting frameRate in if-statement in Processing

When I press a certain key, the speed variable increases or decreases. I've been trying to set a minimum to the frameRate with the code shown below. However, when I'm at 20fps and I decrease my speed variable again, the fps drops to 0 and I can't do anything.

 void draw () {          
    frameRate (60 * speed);
    if (frameRate <= 20) {
         println("frameRate");
         frameRate(60);
         }
    }

Aucun commentaire:

Enregistrer un commentaire