Slightly better layout

This commit is contained in:
Bill Rossi 2025-02-22 13:50:38 -05:00
parent 35c676646c
commit f9e7b8a3cd
3 changed files with 17 additions and 11 deletions

View File

@ -3,9 +3,9 @@
#include "field_multiplier.h"
#include "card.h"
static FieldMultiplier small_field = { "Small Field", 1 };
static FieldMultiplier large_field = { "Large Field", 2 };
static FieldMultiplier grand_field = { "Grand Field", 4 };
static FieldMultiplier small_field = { "Small Field", "", 1 };
static FieldMultiplier large_field = { "Large Field", "Score transfers are doubled", 2 };
static FieldMultiplier grand_field = { "Grand Field", "Score transfers are quadrupled" ,4 };
FieldMultiplier *calculate_field_multiplier(Hand *h) {
bool large = false;

View File

@ -7,6 +7,7 @@ typedef struct FieldMultiplier FieldMultiplier;
struct FieldMultiplier {
char *name;
char *explanation;
int value;
};

21
game.c
View File

@ -19,7 +19,7 @@ void initialize_game(Game *g) {
UnloadImage(cards_image);
g->deck.count = 0;
g->deck.position = (Vector2) { 800, 400 };
g->deck.position = (Vector2) { 500, 300 };
g->deck.display_type = HAND_DISPLAY_DECK;
g->should_close = false;
g->state = GAME_STATE_INITIALIZING;
@ -64,10 +64,10 @@ void initialize_game(Game *g) {
case 41:
t = ANIMAL; break;
}
g->cards[i] = (Card) { i, t, rt, month, { 800, 100 }, false };
g->cards[i] = (Card) { i, t, rt, month, { 500, 300 }, false };
g->cards[i].move.end_time = 0.;
g->cards[i].move.position = &g->cards[i].position;
g->cards[i].move.destination = (Vector2) { 800, 400 };
g->cards[i].move.destination = (Vector2) { 500, 300 };
g->cards[i].order = i;
g->cards[i].selected = false;
}
@ -107,8 +107,6 @@ void initialize_game(Game *g) {
g->right.hand.display_type = HAND_DISPLAY_ROW;
g->left.hand.position = (Vector2) { 50, 125 };
g->left.hand.display_type = HAND_DISPLAY_ROW;
g->field.position = (Vector2) { 400, 300 };
g->field.display_type = HAND_DISPLAY_FIELD;
g->player.scored.position = (Vector2) { 300, 750 };
g->player.scored.display_type = HAND_DISPLAY_SCORED;
g->right.scored.position = (Vector2) { 750, 25 };
@ -116,6 +114,9 @@ void initialize_game(Game *g) {
g->left.scored.position = (Vector2) { 50, 25 };
g->left.scored.display_type = HAND_DISPLAY_SCORED;
g->field.position = (Vector2) { 600, 300 };
g->field.display_type = HAND_DISPLAY_FIELD;
strcpy(teyaku_calculation, "");
int dealer = rand() % 3;
@ -464,7 +465,7 @@ void run_frame_showing_card_from_deck(Game *g) {
add_to_hand(&g->deck, top_card);
top_card->visible = true;
top_card->move.end_time = 0.3;
top_card->move.destination.x = top_card->move.destination.x + 100;
top_card->move.destination.y = top_card->move.destination.y + 150;
g->state = GAME_STATE_PLAYING_FROM_DECK;
}
@ -760,8 +761,12 @@ void draw_frame(Game *g) {
draw_cards(g);
if (g->state == GAME_STATE_DEALING) DrawText("Dealing....", 60, 385, 40, BLACK);
else if (g->field_multiplier) DrawText(g->field_multiplier->name, 60, 385, 40, BLACK);
if (g->state == GAME_STATE_DEALING) {
DrawText("Dealing....", 60, 385, 40, BLACK);
} else if (g->field_multiplier) {
DrawText(g->field_multiplier->name, 60, 385, 30, BLACK);
DrawText(g->field_multiplier->explanation, 60, 445, 20, BLACK);
}
if (g->player.teyaku.calculated) {
char s[200];