ID非公開さん
2023/9/27 22:58
1回答
processingでスタートボタンを押したら分単位のタイマーが作動するというものを作ろうと祖輝のですがmillis()を分単位に変えるべく60000で割るとライマーが作動しなくなってしまいます。
processingでスタートボタンを押したら分単位のタイマーが作動するというものを作ろうと祖輝のですがmillis()を分単位に変えるべく60000で割るとライマーが作動しなくなってしまいます。 100までは割ってもさどうするのですが、1000から作動しなくなります。なぜですか? int starttime; int stoptime; int minutes; int total; int elapsedtime; boolean movetime=false; boolean anmovetime=false; void mousePressed() { if (dist(width/2-200, height-200, mouseX, mouseY)<100) { starttime=millis(); movetime=true; } if (dist(width/2+200, height-200, mouseX, mouseY)<100) { movetime=false; } } void setup() { size(1000, 800); } void draw() { background(255); if (movetime) { if(!anmovetime){ total+= elapsedtime=millis()-starttime; minutes = elapsedtime/1000; } } fill(255); ellipse(width/2-100, height-200, 100, 100); ellipse(width/2+100, height-200, 100, 100); fill(0); text(minutes, width/2, height/2); text("start", width/2-110, height-200); text("stop", width/2+100, height-200); }
プログラミング・35閲覧