#include #include #include #include #include #include "card.h" #include "move.h" #include "teyaku.h" char *text = "こんにちわ、 世界!"; int main(int argc, char** argv) { InitWindow(800, 450, "Hanafuda Hachi-Hachi"); SetTargetFPS(60); Hand h; h.cards[0] = (Card) { 1, BRIGHT, RIBBON_NONE, NOVEMBER, (Vector2) { 0, 0 } }; h.cards[1] = (Card) { 1, ANIMAL, RIBBON_NONE, NOVEMBER, (Vector2) { 0, 0 } }; h.cards[2] = (Card) { 1, RIBBON, RIBBON_PLAIN, NOVEMBER, (Vector2) { 0, 0 } }; h.cards[3] = (Card) { 1, CHAFF, RIBBON_NONE, NOVEMBER, (Vector2) { 0, 0 } }; h.cards[4] = (Card) { 1, CHAFF, RIBBON_NONE, DECEMBER, (Vector2) { 0, 0 } }; h.cards[5] = (Card) { 1, CHAFF, RIBBON_NONE, DECEMBER, (Vector2) { 0, 0 } }; h.cards[6] = (Card) { 1, CHAFF, RIBBON_NONE, DECEMBER, (Vector2) { 0, 0 } }; h.count = 7; printf("Teyaku: %d\n", calculate_teyaku(h)); Card *c = malloc(sizeof(Card)); c->position = (Vector2) { 200, 200 }; Move *m = malloc(sizeof(Move)); m->origin = c->position; m->destination = c->position; m->curve = CURVE_EASE_IN_OUT; float delta; Vector2 mouse_position; while (!WindowShouldClose()) { delta = GetFrameTime(); if (IsMouseButtonPressed(0)) { mouse_position = GetMousePosition(); m->origin = c->position; m->destination = mouse_position; m->current_time = 0.; m->end_time = 1.; } c->position = move_position(m, delta); BeginDrawing(); ClearBackground(RAYWHITE); draw_card(c); EndDrawing(); } CloseWindow(); return 0; }