diff --git a/src/Controller.cpp b/src/Controller.cpp index 733c1c2..61aaf87 100755 --- a/src/Controller.cpp +++ b/src/Controller.cpp @@ -29,7 +29,7 @@ Controller::~Controller(){delete snake;} static void printScore(unsigned int _score){ string str = "Score: " + to_string(_score); - printMsg(0, 0, (char*)str.c_str()); //-1, -1 because otherwise it'll be printed inside the game box + printMsg(-1, -1, (char*)str.c_str()); //-1, -1 because otherwise it'll be printed inside the game box } int Controller::act(void){ diff --git a/src/Graphics.cpp b/src/Graphics.cpp index cab15a0..6ce0713 100755 --- a/src/Graphics.cpp +++ b/src/Graphics.cpp @@ -62,7 +62,13 @@ void printChar(int y, int x, graphics_input img){ } void printMsg(int y, int x, char* str){ - mvwaddstr(_box, y, x, str); + if(y>0 && x>0) + mvwaddstr(_box, y, x, str); + else{ + if(y < 0) y = 2 + y; + if(x < 0) x = 0; + mvaddstr(y, x, str); + } refresh(); wrefresh(_box); }