diff --git a/include/screen.h b/include/screen.h index d8a59de..8fb5dd1 100644 --- a/include/screen.h +++ b/include/screen.h @@ -1,13 +1,13 @@ #ifndef __SCREEN_H__ #define __SCREEN_H__ +typedef char Point; typedef struct screen_t { int width; int height; - char *screen; + Point *screen; } Screen; -typedef char Point; Screen *screenCreate(int width, int height, Point fill_value); void screenFree(Screen *screen); diff --git a/src/player.c b/src/player.c index 00f229f..9170645 100644 --- a/src/player.c +++ b/src/player.c @@ -15,6 +15,8 @@ Player *playerCreate(Direction direction, int x, int y, int score) player->head = head; player->score = score; player->direction = direction; + + return player; } void playerFree(Player *player) diff --git a/src/screen.c b/src/screen.c index 861df19..514af70 100644 --- a/src/screen.c +++ b/src/screen.c @@ -44,7 +44,7 @@ void screenShow(Screen *screen) } } -void screenSet(Screen *screen, char fill_value) +void screenSet(Screen *screen, Point fill_value) { memset(screen->screen, fill_value, screen->width * screen->height * sizeof(char)); }