943,840 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 389
  • C++ RSS
Sep 7th, 2009
0

Some Easy help needed please.

Expand Post »
so here the thing im practicing c++ just started all this is in cmd and im making combat simulator as of a project on another forum that i guesed good practice so im doing it but i decided to make 3 classes :archer , mage , barb and i got mini intro now i need to figure out a way to chose wich class the player wants...and im stuck there you guys got tips for me? do i have to make 3 stories ? ore is there a way to juste do if ( i chose archer then im archer ) and forget about barb and mage im sorry if im not very clear im trying tho got ANY ideas? let me know?

Sawm <3

anything could help im going to try until i achieve !
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
thenewbie is offline Offline
3 posts
since Aug 2008
Sep 7th, 2009
0

Re: Some Easy help needed please.

You might be able to do it as a class array
Last edited by 3Dwannabe; Sep 7th, 2009 at 6:37 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
3Dwannabe is offline Offline
1 posts
since Jul 2009
Sep 11th, 2009
0

Re: Some Easy help needed please.

I dont understand what you trying to do
Reputation Points: 11
Solved Threads: 1
Light Poster
namehere05 is offline Offline
25 posts
since Dec 2008
Sep 12th, 2009
0

Re: Some Easy help needed please.

Click to Expand / Collapse  Quote originally posted by thenewbie ...
so here the thing im practicing c++ just started all this is in cmd and im making combat simulator as of a project on another forum that i guesed good practice so im doing it but i decided to make 3 classes :archer , mage , barb and i got mini intro now i need to figure out a way to chose wich class the player wants...and im stuck there you guys got tips for me? do i have to make 3 stories ? ore is there a way to juste do if ( i chose archer then im archer ) and forget about barb and mage im sorry if im not very clear im trying tho got ANY ideas? let me know?
I'm not exactly sure what your trying to do either, however it would seem your aiming for a 'pick a class' kind of option after your 'intro' and are unsure how to continue.
Obviously without knowing some specifics it's hard to recommend a specific strategy but i'll outline your general options as I see them.
If your using a command line style program (text games are so last century!) then you'll want to ask the user what character type they desire and parse the string input to see if it contains any keywords or identifiers (IE: strcmp(InputString, "Barbarian")).
If your using some kind of window system interface a good old three buttons will do fine. For anything more advanced your looking at a graphics API and a discussion of GUI and HCI that you'll want team input on.
Once the player type is selected your further options depend somewhat on the use of that data. If they simply pick a class, have some kind of battle and quit then you may simply wish to have a basic 'PlayerType' (C++)class with barbarian, mage, etc inherited from it. You could then store a base pointer in the player information (strut?) and set it dependant on what kind of character the player chooses.
If your going to need any kind of permanent storage of the users character (saving the game, MMO, etc) then you'll want to have a player class with support for all classes that is parsed differently depending on an Enumerated value or alike. That way you can simply write the players information to a file and load it later without needing to worry about where things are stored or pointers.

Quote ...
anything could help im going to try until i achieve !
That's a great attitude to have! your sure to succeed, however the invaluable aid the oracle of us many internet people can only be summoned with detailed information.
Simply saying 'I'm making something what do I do' won't really cut it, we need to know what your doing, how your doing it, with what, when and what you have so far. Then we can comment on the many paths that lie before you.
Reputation Points: 70
Solved Threads: 4
Light Poster
DarthPJB is offline Offline
47 posts
since May 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: convert string to int array
Next Thread in C++ Forum Timeline: Constructor Problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC