How to draw only a character every time tick, but not flinging a field every time? Well, for example: there is a two-dimensional array, in it a certain coordinate is a character. How do I draw a character separately?
- Your question is rather muddyly worded, but for drawing in the console, try looking at the ncurses library. - αλεχολυτ
- @alexolut, yes, I’m not really clear what I want, I don’t know how to correctly describe what I need) - goodalien
- It depends on where you work. In Windows, there is a stack of console functions for displaying characters with certain attributes in a certain place. If I understand correctly that you have a console, i.e. in text mode the game ... - Harry
- So you describe on what technology the game is done. - Alexander Petrov
1 answer
I'm not sure that I understood the question correctly, but I will try to answer as I understand.
The field is drawn only once. Before you draw a character, you need to save a piece of the field where it is drawn in the matrix. Then, when the character needs to be drawn again (for example, in another place or in another pose), you need to paint over a piece of the field (data from the matrix). Thus, before each drawing of the character simply save a piece of the field, and then load it back - the entire field is not redrawn.
For a piece of the field and storage of the character itself, the matrix is desirable to be rectangular.
As for the technical aspects of being ... it depends on the means of technology that you use. And you did not specify them.