Thread: Questions on Classes

  1. #1
    Registered User
    Join Date
    Mar 2010
    Salem's Lot

    Exclamation Questions on Classes

    I'm wanting to use classes for my game.

    I want to be able to move north, south, east, or west and while I move I want to see descriptions of the new areas that I am walking into.

    Keep in mind that this is going to be a text base game (MUD).

    I'm really confused with all of this code that the tutorial pasted for me.

    I understand the public, private, and protected parts. I also understand the constructor and destructor.

    I just am really confused on how to get my character to walk and see the descriptions I give for rooms.

    Any help is appreciated.


  2. #2
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Liverpool UK
    well you need to put some brief code to explain your dilemma.

    if you have been copying and pasting large chunks of code, then its going to take you a long time to understand what is going on there, if its all new stuff to you, its not a good idea to wholesale copy stuff around, even your own code can give you issues.

    your basic class in this example would really just describe your character, or a type of character and its attributes, current status etc.

    Movement in text based game? You have to think about how you can represent this concept to the player of the game, and then try and build that into your code, i dont think the character class should look after this aspect itself, but maybe it could include data to describe a characters current movement speed and direction for example, i have never coded a text game myself though so am just thinking aloud.
    The simplest way to show cover movement is to just show a message after choosing an action / direction i reckon

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. questions about classes(implementation files)
    By Link_26 in forum C++ Programming
    Replies: 6
    Last Post: 06-22-2006, 09:48 AM
  2. Prime Number Generator... Help !?!!
    By Halo in forum C++ Programming
    Replies: 9
    Last Post: 10-20-2003, 07:26 PM
  3. include question
    By Wanted420 in forum C++ Programming
    Replies: 8
    Last Post: 10-17-2003, 03:49 AM
  4. Sharing a variable between classes of different .CPP files
    By divingcrab in forum C++ Programming
    Replies: 5
    Last Post: 07-07-2002, 02:57 PM
  5. 2 questions - classes and variables
    By phantom in forum C++ Programming
    Replies: 8
    Last Post: 09-25-2001, 09:22 PM