how to make one part of console don't effect with "cls"? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

how to make one part of console don't effect with "cls"?

I wanted to see is there any possible way when I'm using system ("cls") walls ( walls of the game ) don't tickle? like this game on youtube using c++ https://www.youtube.com/watch?v=nDdKIxnEyh0

14th Dec 2017, 12:49 PM
Light
Light - avatar
4 Answers
+ 6
You have to do that simply because it is a console game. In fact, we do the same with window game, we clear the window and redisplay everything (it is done so quickly that it is not noticeable)
14th Dec 2017, 1:12 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 5
I do not know if tickling can be prevented in console, try using a console display library like ncurses
14th Dec 2017, 1:13 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 4
If you do not want a part to be cleared, you can simply re display it just after the call of system. Am I assuming right if I think you are using windows OS ?
14th Dec 2017, 12:56 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 2
well in any console game ( like snake , pong ) you have to use cls then re-display all characters ( with their new location ) I want to don't cls a part of the game so tickling in console game gets decreased ( for example, I never want to move walls why I have to clear and re-display them? )
14th Dec 2017, 1:12 PM
Light
Light - avatar