diff --git a/snake.cpp b/snake.cpp index fbd71f6..d9b18ce 100644 --- a/snake.cpp +++ b/snake.cpp @@ -25,7 +25,7 @@ void setup() { } void draw() { - system("cls"); + SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), {0,0}); for(int i = 0; i < width + 2; i++) cout << "#"; cout << "\n"; for(int i = 0; i < height; i++) { @@ -128,6 +128,7 @@ void logic() { } int main() { + system("cls"); setup(); while(!gameOver){ draw();