void timeloop() { if(beat>80) {dir=-1;} else if(beat<-30) {dir=1;} beat=(beat+dir); timer=(timer+1)%(timemax+1); } void controltimemax() { int numbugs; numbugs=s.getNUMBUG(); timemax=int(180- float(numbugs)*140/15); }