hanafuda/main.c

50 lines
992 B
C

#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <raylib.h>
#include "card.h"
#include "move.h"
char *text = "こんにちわ、 世界!";
int main(int argc, char** argv) {
InitWindow(800, 450, "Hanafuda Hachi-Hachi");
SetTargetFPS(60);
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;
}