main interface

This is a discussion on main interface within the C++ Programming forums, part of the General Programming Boards category; umm hi Im making a text RPG with C++ and i have a number of problems (im doing this for ...

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    57

    main interface

    umm hi Im making a text RPG with C++ and i have a number of problems (im doing this for learning purposes btw);

    ive made this main screen which displays a box for the game text to appear in but i cant do it with out disrupting the whole box. the text has to be updated frequently
    i was thinkin iomanip but i think i will have the same problem
    in the places where it says spells or wepon they will call to the struct for that wepon or spell each time the main interface is updated
    well take a look i apreciate all suggestions thanx:

    Code:
    #include <iostream.h>
    
    const char NL = '\n';
    int main(int argc, char* argv[])
    {
    	
    	cout << NL; 
    	cout << "Player name goes here\t\t\t\t\t\tcurrent wepon" << NL;
    	cout << "                     \t\t\t\t\t\tcurrent spell";
    	cout << NL << NL << NL << NL << NL;
    	cout << "\t\t";
    	
    	for (int i = 0;i<50;i++)
    		cout << "*";
    	cout << endl << "\t\t";
    	
    	for (int j = 0;j<10;j++)
    		cout << "*" << "                                                " << "*" << endl << "\t\t";
    	
    	
    	for (int q = 0;q<50;q++)
    		cout << "*";
    	
    	cout << NL << NL << NL << NL;
    	cout << "\tYour current life is:" << "****************************************" << NL;	//will call to apropriate struct for correct # of stars
    	cout << "\tYour current mana is:" << "****************************************" << NL;
    	
    	
    	return 0;
    }
    =@-OmegatronO-@=

  2. #2
    Unregistered
    Guest
    you need better formatting. try setw( ) which isnt bad, or failing that start looking into printf type functions

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    203
    const char NL = '\n';
    what would be the purpose of doing this?
    why not just use endl or \n

  4. #4
    Registered User
    Join Date
    Aug 2001
    Posts
    57
    I dont know haha

    ask Rob McGregor
    =@-OmegatronO-@=

  5. #5
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    Hehe, I have that book. The explanations are nice and simplistic, but the code is lacking somewhat.

    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Calling IRichEditOle interface methods
    By Niara in forum C Programming
    Replies: 2
    Last Post: 01-16-2009, 12:23 PM
  2. Return Statement
    By Daveo in forum C Programming
    Replies: 21
    Last Post: 11-09-2004, 04:14 AM
  3. Int Main or Void Main?
    By FromHolland in forum C++ Programming
    Replies: 9
    Last Post: 06-12-2003, 04:29 PM
  4. int main (), main (), main (void), int main (void) HELP!!!
    By SmokingMonkey in forum C++ Programming
    Replies: 7
    Last Post: 05-31-2003, 09:46 PM
  5. what to do with the main window
    By stallion in forum Windows Programming
    Replies: 2
    Last Post: 01-28-2003, 07:58 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21