Put cards in the right place ha haaaaa
This commit is contained in:
parent
49af79f932
commit
05e34e2fbb
4
card.c
4
card.c
@ -93,6 +93,10 @@ void add_to_hand(Hand *h, Card *c) {
|
|||||||
c->move.destination.x = h->position.x;
|
c->move.destination.x = h->position.x;
|
||||||
c->move.destination.y = h->position.y;
|
c->move.destination.y = h->position.y;
|
||||||
break;
|
break;
|
||||||
|
case HAND_DISPLAY_SCORED:
|
||||||
|
c->move.destination.x = h->position.x + (first_open_spot * (CARD_WIDTH - 10));
|
||||||
|
c->move.destination.y = h->position.y;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
c->move.curve = CURVE_EASE_IN_OUT;
|
c->move.curve = CURVE_EASE_IN_OUT;
|
||||||
c->move.current_time = 0.;
|
c->move.current_time = 0.;
|
||||||
|
1
card.h
1
card.h
@ -63,6 +63,7 @@ typedef enum HandDisplayType {
|
|||||||
HAND_DISPLAY_ROW,
|
HAND_DISPLAY_ROW,
|
||||||
HAND_DISPLAY_FIELD,
|
HAND_DISPLAY_FIELD,
|
||||||
HAND_DISPLAY_DECK,
|
HAND_DISPLAY_DECK,
|
||||||
|
HAND_DISPLAY_SCORED,
|
||||||
} HandDisplayType;
|
} HandDisplayType;
|
||||||
|
|
||||||
struct Hand {
|
struct Hand {
|
||||||
|
14
game.c
14
game.c
@ -81,13 +81,13 @@ void initialize_game(Game *g) {
|
|||||||
g->field.display_type = HAND_DISPLAY_FIELD;
|
g->field.display_type = HAND_DISPLAY_FIELD;
|
||||||
g->player_scored.count = 0;
|
g->player_scored.count = 0;
|
||||||
g->player_scored.position = (Vector2) { 300, 750 };
|
g->player_scored.position = (Vector2) { 300, 750 };
|
||||||
g->player_scored.display_type = HAND_DISPLAY_ROW;
|
g->player_scored.display_type = HAND_DISPLAY_SCORED;
|
||||||
g->right_scored.count = 0;
|
g->right_scored.count = 0;
|
||||||
g->right_scored.position = (Vector2) { 750, 25 };
|
g->right_scored.position = (Vector2) { 750, 25 };
|
||||||
g->right_scored.display_type = HAND_DISPLAY_ROW;
|
g->right_scored.display_type = HAND_DISPLAY_SCORED;
|
||||||
g->left_scored.count = 0;
|
g->left_scored.count = 0;
|
||||||
g->left_scored.position = (Vector2) { 50, 25 };
|
g->left_scored.position = (Vector2) { 50, 25 };
|
||||||
g->left_scored.display_type = HAND_DISPLAY_ROW;
|
g->left_scored.display_type = HAND_DISPLAY_SCORED;
|
||||||
|
|
||||||
strcpy(teyaku_calculation, "");
|
strcpy(teyaku_calculation, "");
|
||||||
|
|
||||||
@ -192,8 +192,6 @@ bool run_frame_from_deck(Game *g, Hand *to_hand) {
|
|||||||
|
|
||||||
void run_frame_ai_playing(Game *g, Hand *hand, Hand *scored) {
|
void run_frame_ai_playing(Game *g, Hand *hand, Hand *scored) {
|
||||||
Play play = ai_play(hand, &g->field);
|
Play play = ai_play(hand, &g->field);
|
||||||
if (play.target) printf("Playing %d on %d\n", play.played->index, play.target->index);
|
|
||||||
else printf("Playing %d on field\n", play.played->index);
|
|
||||||
play.played->visible = true;
|
play.played->visible = true;
|
||||||
|
|
||||||
if (play.target) {
|
if (play.target) {
|
||||||
@ -285,30 +283,26 @@ void run_frame_player_choosing_target(Game *g) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void run_frame_player_from_deck(Game *g) {
|
void run_frame_player_from_deck(Game *g) {
|
||||||
if (run_frame_from_deck(g, &g->right_hand))
|
if (run_frame_from_deck(g, &g->player_scored))
|
||||||
g->state = GAME_STATE_RIGHT_PLAYING;
|
g->state = GAME_STATE_RIGHT_PLAYING;
|
||||||
}
|
}
|
||||||
|
|
||||||
void run_frame_right_playing(Game *g) {
|
void run_frame_right_playing(Game *g) {
|
||||||
printf("right play\n");
|
|
||||||
run_frame_ai_playing(g, &g->right_hand, &g->right_scored);
|
run_frame_ai_playing(g, &g->right_hand, &g->right_scored);
|
||||||
g->state = GAME_STATE_RIGHT_FROM_DECK;
|
g->state = GAME_STATE_RIGHT_FROM_DECK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void run_frame_right_from_deck(Game *g) {
|
void run_frame_right_from_deck(Game *g) {
|
||||||
printf("right deck\n");
|
|
||||||
if (run_frame_from_deck(g, &g->right_scored))
|
if (run_frame_from_deck(g, &g->right_scored))
|
||||||
g->state = GAME_STATE_LEFT_PLAYING;
|
g->state = GAME_STATE_LEFT_PLAYING;
|
||||||
}
|
}
|
||||||
|
|
||||||
void run_frame_left_playing(Game *g) {
|
void run_frame_left_playing(Game *g) {
|
||||||
printf("left play\n");
|
|
||||||
run_frame_ai_playing(g, &g->left_hand, &g->left_scored);
|
run_frame_ai_playing(g, &g->left_hand, &g->left_scored);
|
||||||
g->state = GAME_STATE_LEFT_FROM_DECK;
|
g->state = GAME_STATE_LEFT_FROM_DECK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void run_frame_left_from_deck(Game *g) {
|
void run_frame_left_from_deck(Game *g) {
|
||||||
printf("left deck\n");
|
|
||||||
if (run_frame_from_deck(g, &g->left_scored))
|
if (run_frame_from_deck(g, &g->left_scored))
|
||||||
g->state = GAME_STATE_PLAYER_CHOOSING_FROM_HAND;
|
g->state = GAME_STATE_PLAYER_CHOOSING_FROM_HAND;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user