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;