I was about to make a simple game on console. I was a surprise on what I saw.
1.The whole console sparkles
2.Player doesn't move correctly. Some times he "jumpes" to the second line even doe I have only moved right/left. There are other bugs too.
3.While player moves over, some text starts to be drawn. First, while going only right, it draws "cls". Further, It draws some more text that looks like a script or something. Eventually, It goes mad! It draws the text by it self, and it beeps (probably cause it draws chr(7) sometimes)!
4.When I am at the beginning, if I go any further up or left, program ends.
I wouldn't exactly call it perfect... For one thing, I don't think this will do what you think it does: string(" ",y*60) <.....> string(" ",x)
The (char* s, int n) constructor takes the n first characters of *s. I think you wanted the (int n, char* s) constructor instead.
Secondly, system() calls are bad. Find a different way to clear the screen and pause. There are many topics about it on the forum!
I'm relatively new to C++, and I know system() stuff are not good, but I'm not so experienced enough to create a code by my self. I have some examples that I can use, but I just wanted the code to be short.
Also, I don't get this part:
The (char* s, int n) constructor takes the n first characters of *s. I think you wanted the (int n, char* s) constructor instead.
Does this mean I use string() function like this: string(n,str)?
I have tried that way, but the error says its string(str,n)