From 3bac02c752ca2e4739f0cce13aae63c46801e27f Mon Sep 17 00:00:00 2001
From: Bill Rossi <bassguitarbill@gmail.com>
Date: Sat, 8 Feb 2025 07:33:23 -0500
Subject: [PATCH] Draw a target for playing a nonmatching card

---
 card.c | 11 ++++++++++-
 card.h |  1 +
 game.c |  5 +++--
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/card.c b/card.c
index fc8f936..5a7fbf2 100644
--- a/card.c
+++ b/card.c
@@ -62,7 +62,7 @@ void add_to_hand(Hand *h, Card *c) {
   }
   c->move.curve = CURVE_EASE_IN_OUT;
   c->move.current_time = 0.;
-  c->move.end_time = 0.5;
+  c->move.end_time = 0.1;
 
   h->count++;
 }
@@ -79,3 +79,12 @@ void deal(Hand *from, Hand *to, int count, bool up) {
     from->count--;
   }
 }
+
+Rectangle next_card_position(Hand *h) {
+  return (Rectangle) {
+    h->position.x + ((h->count / 2) * (CARD_WIDTH + 10)),
+    h->position.y + (h->count % 2 * (CARD_HEIGHT + 10)),
+    CARD_WIDTH,
+    CARD_HEIGHT
+  };
+}
diff --git a/card.h b/card.h
index eb9575a..b949f60 100644
--- a/card.h
+++ b/card.h
@@ -75,5 +75,6 @@ bool point_within_card(Card *c, Vector2 v);
 void shuffle_hand(Hand *h);
 void deal(Hand *from, Hand *to, int count, bool up);
 bool card_done_moving(Card *c);
+Rectangle next_card_position(Hand *h);
 
 #endif
diff --git a/game.c b/game.c
index 6c110f3..65060c7 100644
--- a/game.c
+++ b/game.c
@@ -231,10 +231,11 @@ void draw_frame(Game *g) {
 
   switch (g->state) {
   case GAME_STATE_PLAYER_CHOOSING_FROM_HAND:
-    DrawText("Choose a card to play", 60, 485, 40, BLACK);
+    DrawText("Choose a card to play", 60, 485, 20, BLACK);
     break;
   case GAME_STATE_PLAYER_CHOOSING_TARGET:
-    DrawText("Choose a target on the field", 60, 485, 40, BLACK);
+    DrawText("Choose a target on the field", 60, 485, 20, BLACK);
+    DrawRectangleRec(next_card_position(&g->field), BLUE);
     break;
   default:
     break;