diff --git a/final/game.c b/final/game.c index 71b7539..031cf38 100644 --- a/final/game.c +++ b/final/game.c @@ -23,13 +23,13 @@ typedef struct { } GameState; Tetromino tetrominoes[] = { - {{{0,0}, {1,0}, {0,1}, {1,1}}, {0,0}}, // Square - {{{0,0}, {1,0}, {2,0}, {3,0}}, {0,0}}, // Line - {{{0,0}, {1,0}, {1,1}, {2,1}}, {0,0}}, // Z shape - {{{1,0}, {2,0}, {0,1}, {1,1}}, {0,0}}, // S shape - {{{0,0}, {1,0}, {2,0}, {1,1}}, {0,0}}, // T shape - {{{0,0}, {0,1}, {1,1}, {2,1}}, {0,0}}, // L shape - {{{2,0}, {0,1}, {1,1}, {2,1}}, {0,0}} // J shape + {{{0,0}, {1,0}, {0,1}, {1,1}}, {0,0}}, // Štvorec + {{{0,0}, {1,0}, {2,0}, {3,0}}, {0,0}}, // Čiara + {{{0,0}, {1,0}, {1,1}, {2,1}}, {0,0}}, // Z tvar + {{{1,0}, {2,0}, {0,1}, {1,1}}, {0,0}}, // S tvar + {{{0,0}, {1,0}, {2,0}, {1,1}}, {0,0}}, // T tvar + {{{0,0}, {0,1}, {1,1}, {2,1}}, {0,0}}, // L tvar + {{{2,0}, {0,1}, {1,1}, {2,1}}, {0,0}} // J tvar }; void draw_grid(GameState* game) { @@ -130,3 +130,20 @@ int game_event(struct event* event, void* state) { return 0; } +int main() { + init_world(WIDTH, HEIGHT); + void* game = init_game(); + + struct event ev; + while (1) { + ev.key = getch(); + if (game_event(&ev, game)) { + break; + } + } + + endwin(); + free(game); + return 0; +} +