What would i need to know about to make a console text based game in C++. I've been wondering this for a while now, so i hope you can help me.
Thanks in advance!
What would i need to know about to make a console text based game in C++. I've been wondering this for a while now, so i hope you can help me.
Thanks in advance!
C++ basics.
Functions, pointers ( not vital ) program flow and structure and perhaps some light OOP.
Start small and build it up. It might also help to plan a rough idea on paper first
Double Helix STL
how would i use a load or save feature, would i write the usernames and passwords to a file and make it readonly or something?
Yes. You would have to use fstream. But if you are talking about making a basic text game, I would not worry to much about that sort of thing at the moment. Get the bulk of the code working and working well first, before you make any tech changes. Also it helps to add a player inventory ( vector perhaps ? ) to track some of the players personal data.
Double Helix STL
Whats vector? Thats the only part in the thread that i don't get.
I have used fstream a few times and know a little about pointers and OOP.
And know the basics ofcourse.
As in std::vector of the STL (Standard Template Library). Most C++ tutorials at least go over the basics of the STL.
Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.
- Mike McShaffry
Think of a vector as a container. For example, there can be a vector of data type int or a vector of data type string. If you know what arrays are, understanding vectors should be simple. A vector is basically a dynamic array, able to shrink and expand to accommodate information.
Videogame Memories!
A site dedicated to keeping videogame memories alive!
http://www.videogamememories.com/
Share your experiences with us now!
"We will game forever!"
Active example:
One of there many uses.Code:std::vector<std::string> inven; std::vector<std::string>::iterator iter; inven.push_back("SWORD"); for ( iter = inven.begin(); iter != inven.end(); iter++ ) { std::cout << *iter << std::endl; }
Double Helix STL
inven = Inventory
iter = iterator
Again last post prior to xzk was nearly 4 months ago.
Closed. Please do not bump old threads.