first commit

This commit is contained in:
Stefano Rossi 2025-07-10 03:30:51 +02:00
commit b4fa9ed710
Signed by: chadmin
GPG key ID: 9EFA2130646BC893
13 changed files with 749 additions and 0 deletions

44
Classe_ThTiming.pde Normal file
View file

@ -0,0 +1,44 @@
public class ThTiming extends Thread {
private boolean esecuzione;
int r, c;
public ThTiming(int r, int c) {
this.esecuzione = false;
this.r = r;
this.c = c;
}
public void inizia(){
this.esecuzione = true;
this.start();
}
boolean isEsecuzione() {
return this.esecuzione;
}
void run () {
//salvo il colore iniziale
try {
celle[r][c].setWarningColor(color(255, 0, 0, 255));
Thread.sleep(800);
}catch(InterruptedException e) {
esecuzione = false;
}
while (esecuzione) {
for(int i = 0; i<=255 && esecuzione; i += 5){
try {
Thread.sleep(20);
celle[r][c].setWarningColor(color(255, 0, 0, 255 - i));
//println(i);
}
catch(InterruptedException e) {
esecuzione = false;
}
}
esecuzione = false;
celle[r][c].setWarningColor(color(255, 0, 0, 0));
}
}
}