fix(game): resolve flickering issue in game display

This commit is contained in:
2025-09-23 02:54:45 +03:30
parent 9031d42ee4
commit 6d101c9730
+2 -1
View File
@@ -25,7 +25,7 @@ void setup() {
} }
void draw() { void draw() {
system("cls"); SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), {0,0});
for(int i = 0; i < width + 2; i++) cout << "#"; for(int i = 0; i < width + 2; i++) cout << "#";
cout << "\n"; cout << "\n";
for(int i = 0; i < height; i++) { for(int i = 0; i < height; i++) {
@@ -128,6 +128,7 @@ void logic() {
} }
int main() { int main() {
system("cls");
setup(); setup();
while(!gameOver){ while(!gameOver){
draw(); draw();