0

I'm looking to add something exciting to my final project this semester. I'm trying to create a text-based combat game and I'm using a round counter for each attack. I want the round counter to display in the middle both vertically and horizontally of a blank screen between rounds. I know how to clear the screen, but how do I display it in the center? I thought of using

cout << "                  Round 1                    ";

but in order for that to display in the middle, the only thing I know how to do is to add like, 20 lines of

cout << endl;

Please help me.

Yu Hao
  • 119,891
  • 44
  • 235
  • 294

1 Answers1

4

If you'd like to keep your game in the console window, ncurses allows you to set where you'd like to print.

You are also given the option of some GUI stuff like menus, message boxes, etc.

Others have posted similar solutions to this here.

mas4
  • 989
  • 1
  • 8
  • 20
  • Thank you very much. I love how fast the people on these forums are. – Nate Cowley May 05 '15 at 04:48
  • @NateCowley, Stackoverflow is not a forum. :P Also, please accept the answer if it solved your problem. – merlin2011 May 05 '15 at 04:59
  • Ok, thank you for the information about Stackoverflow not being a forum. I would've accepted the answer earlier, but it said I had to wait a little while and I got distracted trying to implement your answer into my code. – Nate Cowley May 05 '15 at 05:00