#ifndef SNAKE_H #define SNAKE_H #include #include #include #include "defaults.h" typedef struct { unsigned char g; unsigned char r; unsigned char b; } Color; typedef enum { DIR_UP, DIR_DOWN, DIR_LEFT, DIR_RIGHT } Direction; typedef struct { int x; int y; Color color; Color color_old; } SnakeTile; typedef struct { SnakeTile nodes[MAX_SNAKE_LENGTH]; int head_index; int tail_index; Direction direction; int length; } Snake; // Function declarations void snake_Init(Snake* snake, int start_x, int start_y); void snake_SetDirection(Snake* snake, Direction new_dir); bool snake_Move(Snake* snake, bool is_next_step, uint64_t diff_max, uint64_t diff); bool snake_IsColliding(Snake* snake); void spawn_apple(); #endif // SNAKE_H