fixed static
This commit is contained in:
parent
c4171dc5d5
commit
f8ecb7be23
4 changed files with 9 additions and 8 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -53,3 +53,6 @@ dkms.conf
|
||||||
src/project.md
|
src/project.md
|
||||||
src/tetris_bin
|
src/tetris_bin
|
||||||
src/.gpskip
|
src/.gpskip
|
||||||
|
.gpskip
|
||||||
|
ginpee.toml
|
||||||
|
src/ginpee.toml
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
.git/
|
.git/
|
||||||
.vscode/
|
.vscode/
|
||||||
.idea/
|
.idea/
|
||||||
|
|
@ -65,7 +64,9 @@ modules.order
|
||||||
Module.symvers
|
Module.symvers
|
||||||
Mkfile.old
|
Mkfile.old
|
||||||
dkms.conf
|
dkms.conf
|
||||||
project.md
|
src/project.md
|
||||||
tetris_bin
|
src/tetris_bin
|
||||||
|
src/.gpskip
|
||||||
|
.gpskip
|
||||||
ginpee.toml
|
ginpee.toml
|
||||||
project.md
|
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ GameStateData* get_game_state() {
|
||||||
return &game_state;
|
return &game_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool check_collision() {
|
bool check_collision() {
|
||||||
Figure* f = &game_state.current_figure;
|
Figure* f = &game_state.current_figure;
|
||||||
const int (*shape)[4] = get_figure_shape(f->type, f->rotation);
|
const int (*shape)[4] = get_figure_shape(f->type, f->rotation);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,14 +28,12 @@ typedef struct {
|
||||||
int rotation; // Поворот (0–3)
|
int rotation; // Поворот (0–3)
|
||||||
} Figure;
|
} Figure;
|
||||||
|
|
||||||
// Структура состояния игры
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int field[FIELD_HEIGHT][FIELD_WIDTH]; // Игровое поле
|
int field[FIELD_HEIGHT][FIELD_WIDTH]; // Игровое поле
|
||||||
Figure current_figure; // Текущая фигура
|
Figure current_figure; // Текущая фигура
|
||||||
bool figure_active; // Есть активная фигура?
|
bool figure_active; // Есть активная фигура?
|
||||||
} GameStateData;
|
} GameStateData;
|
||||||
|
|
||||||
// Ввод пользователя
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
Undefined = -1,
|
Undefined = -1,
|
||||||
Start,
|
Start,
|
||||||
|
|
@ -56,7 +54,6 @@ typedef enum {
|
||||||
Figure7
|
Figure7
|
||||||
} UserAction_t;
|
} UserAction_t;
|
||||||
|
|
||||||
// Основные функции библиотеки
|
|
||||||
void user_input(UserAction_t action);
|
void user_input(UserAction_t action);
|
||||||
static bool check_collision();
|
static bool check_collision();
|
||||||
GameStateData* get_game_state(void);
|
GameStateData* get_game_state(void);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue