Compare commits

..

No commits in common. 'a4a4caebdf6f95bbe2f93c9c08e56406b1f29c4d' and '626c0115ec3e1a8cd3a91ee44d336dc0d24962c5' have entirely different histories.

@ -22,8 +22,8 @@ class Equipe {
void update() {
// affichage de l'emplacement d'équipe, qui restera toujours fixe
color bgColor = color(255, 255, 255, 120);
color textColor = color(0,0,0);
color bgColor = color(235, 112, 71, 0.8);
color textColor = color(200);
fill(bgColor);
stroke(bgColor);
strokeWeight(0.5);
@ -35,16 +35,6 @@ class Equipe {
float pos_x = this.id<9? this.posX-radius/5: this.posX-radius/3;
text(this.id+1, pos_x, this.posY+radius/5);
// affichage des tours
if (this.tour>0) {
color tourColor = color(255, 255, 255, 200);
fill(tourColor);
textSize(textSize);
float pos_y = this.posY+radius/5+30;
if (this.tour>=10) pos_x = pos_x - 6;
text(this.tour, pos_x, pos_y);
}
// mise à jour du pion
this.pion.draw();
}
@ -52,8 +42,8 @@ class Equipe {
void setScore(int score) {
if (this.score==score) return;
int oldScore = this.score;
//this.incTour();
println("Equipe", this.id+1, "setScore from", oldScore, "to", score);
this.incTour();
println("Equipe", this.id+1, "setScore from", oldScore, "to", score, "turn updated to", this.tour);
this.score = score;
this.update();
Scoreboard.applyScore(this.id, this.score, this.tour);

@ -7,9 +7,9 @@ class Pion extends Position {
Pion(int id) {
super(id);
this.bgColor = color(0, 0, 0);
this.textColor = color(240, 240, 80);
this.textColor = color(255, 255, 255);
this.posX = floor((displayWidth-margin*2)/nombreEquipes)*id+radius/2+margin;
this.posY = displayHeight-46;
this.posY = displayHeight-28;
this.radius = 30;
}

@ -129,13 +129,6 @@ void mousePressed() {
Scoreboard.toggleDisplay();
}
Equipe clicked = findClosestEquipeFromMouse();
//if (!clicked.pion.dragged) {
clicked.incTour();
Scoreboard.save();
println("Clicked on Equipe", clicked.id+1, "set tour to ", clicked.tour);
//}
if (!EDITING) return;
for (int i = 0 ; i < positions.length; i++) {
Position p = positions[i];
@ -247,22 +240,6 @@ Position findClosestPositionFrom(Pion pion) {
return closest;
}
// renvoie l'emplacement d'équipe le plus proche de la souris
Equipe findClosestEquipeFromMouse() {
Equipe closest = equipes[0];
for (int i = 0 ; i < equipes.length; i++) {
Equipe equipe = equipes[i];
float distPion = dist(mouseX, mouseY, equipe.posX, equipe.posY);
float distClosest = dist(mouseX, mouseY, closest.posX, closest.posY);
if (distPion<=distClosest) closest = equipes[i];
}
return closest;
}
boolean fileExists(String filename) {
File f = dataFile(filename);
return f.isFile();

@ -153,9 +153,7 @@ class Scoreboard {
if (teams.size()==0) continue;
// affichage du score
fill(color(0,0,0));
rect(offsetX-66, offsetY+20, 55, 50);
fill(color(240, 240, 80));
fill(color(0, 0, 0));
stroke(color(0, 0, 0));
strokeWeight(1);
textFont(quicksandFont, 40);
@ -170,9 +168,9 @@ class Scoreboard {
for(int j=0; j<teams.size(); j++) {
float subLocalMarginX = (int(teams.get(j))<=9)? margin-10: (int(teams.get(j))>=40)? margin+4: margin;
subLocalMarginX -=4;
fill(color(240, 240, 80));
circle(offsetX-(margin*(j+1))+20, offsetY+(margin*2)-12, 50);
fill(color(0, 0, 0));
circle(offsetX-(margin*(j+1))+20, offsetY+(margin*2)-12, 50);
fill(color(255, 255,255));
textFont(quicksandFont, 32);
//text(teams.get(j), offsetX-(margin*(j+1)), offsetY+(margin*2));
//fill(color(0, 250, 0));

Loading…
Cancel
Save