From ffeadc09714c97e56768b5fcd6ff95f1aee60563 Mon Sep 17 00:00:00 2001 From: Luis Canada Date: Sun, 8 Jan 2023 18:31:24 -0500 Subject: [PATCH] Change score to green if cur player is winning that location --- Location.pde | 15 ++++++++++++++- Snap.pde | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Location.pde b/Location.pde index 3e17d74..33f4337 100644 --- a/Location.pde +++ b/Location.pde @@ -7,6 +7,8 @@ public class Location extends Clickable { protected int p1Scor = 0; protected int p2Scor = 0; + public static final color bigger_score_col = #4ade80; + public static final int space = 200; public static final int gap = 100; @@ -47,10 +49,22 @@ public class Location extends Clickable { textAlign(CENTER); textSize(40); if (curTurn == 1) { + push(); + if (p1Scor > p2Scor) { + fill(bigger_score_col); + } text("" + p1Scor, x, y_score_bellow); + pop(); + text("" + p2Scor, x, y_score_above); } else if (curTurn == 2) { + push(); + if (p2Scor > p1Scor) { + fill(bigger_score_col); + } text("" + p2Scor, x, y_score_bellow); + pop(); + text("" + p1Scor, x, y_score_above); } @@ -140,7 +154,6 @@ public class Location extends Clickable { Location loc = randLocation(); // This card cannot be placed // because there is nowhere to the card to move to! - println(loc); if (loc == null) { return false; } diff --git a/Snap.pde b/Snap.pde index 53334a0..ed2b58c 100644 --- a/Snap.pde +++ b/Snap.pde @@ -178,7 +178,7 @@ void dealCards() { dealer.deal(p2.deck, 7); // Print out the cards of the player for debuggging - printCards(); + // printCards(); } // Print out the cards of the player for debuggging