More cards
This commit is contained in:
parent
1d422015dc
commit
69be5acad2
6
card.c
6
card.c
@ -6,12 +6,12 @@ static char *month_english_abbr[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun"
|
|||||||
void draw_card(Card *c, Texture2D *cards_texture) {
|
void draw_card(Card *c, Texture2D *cards_texture) {
|
||||||
int i_vert = c->index % 4;
|
int i_vert = c->index % 4;
|
||||||
int i_horiz = c->index / 4;
|
int i_horiz = c->index / 4;
|
||||||
int pos_vert = i_vert * 240;
|
int pos_vert = i_vert * CARD_HEIGHT;
|
||||||
int pos_horiz = i_horiz * 146;
|
int pos_horiz = i_horiz * CARD_WIDTH;
|
||||||
|
|
||||||
DrawTexturePro(
|
DrawTexturePro(
|
||||||
*cards_texture,
|
*cards_texture,
|
||||||
(Rectangle) { pos_horiz, pos_vert, 146, 240 },
|
(Rectangle) { pos_horiz, pos_vert, CARD_WIDTH, CARD_HEIGHT },
|
||||||
(Rectangle) { c->position.x, c->position.y, card_size.x, card_size.y },
|
(Rectangle) { c->position.x, c->position.y, card_size.x, card_size.y },
|
||||||
(Vector2) { 0, 0 },
|
(Vector2) { 0, 0 },
|
||||||
0.,
|
0.,
|
||||||
|
4
card.h
4
card.h
@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
typedef struct Card Card;
|
typedef struct Card Card;
|
||||||
typedef struct Hand Hand;
|
typedef struct Hand Hand;
|
||||||
#define CARD_WIDTH 63
|
#define CARD_WIDTH 73
|
||||||
#define CARD_HEIGHT 105
|
#define CARD_HEIGHT 120
|
||||||
#define CARD_BORDER 5
|
#define CARD_BORDER 5
|
||||||
|
|
||||||
typedef enum CardType {
|
typedef enum CardType {
|
||||||
|
Binary file not shown.
BIN
img/cards.png
BIN
img/cards.png
Binary file not shown.
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 346 KiB |
6
main.c
6
main.c
@ -13,7 +13,7 @@
|
|||||||
char *text = "こんにちわ、 世界!";
|
char *text = "こんにちわ、 世界!";
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
InitWindow(800, 550, "Hanafuda Hachi-Hachi");
|
InitWindow(900, 600, "Hanafuda Hachi-Hachi");
|
||||||
SetTargetFPS(60);
|
SetTargetFPS(60);
|
||||||
|
|
||||||
Image cards_image = LoadImage("img/cards.png");
|
Image cards_image = LoadImage("img/cards.png");
|
||||||
@ -70,7 +70,7 @@ int main(int argc, char** argv) {
|
|||||||
case 41:
|
case 41:
|
||||||
t = ANIMAL; break;
|
t = ANIMAL; break;
|
||||||
}
|
}
|
||||||
cards[i] = (Card) { i, t, rt, month, (Vector2) { month * 65, (i % 4) * 110 }, false };
|
cards[i] = (Card) { i, t, rt, month, (Vector2) { month * 75, (i % 4) * 123 }, false };
|
||||||
}
|
}
|
||||||
|
|
||||||
// float delta;
|
// float delta;
|
||||||
@ -122,7 +122,7 @@ int main(int argc, char** argv) {
|
|||||||
dekiyaku_to_string(&d, dekiyaku_calculation);
|
dekiyaku_to_string(&d, dekiyaku_calculation);
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawText(teyaku_calculation, 10, 450, 25, BLACK);
|
DrawText(teyaku_calculation, 10, 550, 25, BLACK);
|
||||||
DrawText(dekiyaku_calculation, 10, 500, 25, BLACK);
|
DrawText(dekiyaku_calculation, 10, 500, 25, BLACK);
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user