Mmm... would be a good interface test. And actually I'd probably have an easier time making a text adventure myself, but that's because I can't make graphics worth a f*** unless they're, say, less than 15 by 15 pixels. Then I can make some interesting designs for some reason.
[EDIT] Just looking at your source code here, noticing a couple things.
void prompt(string msg) { system("cls"); cout<<" ---------------------------------------------------------------------------- \n"; cout<<"\t\t PLAYER\t\t LOCATION\n"; cout<<"\t\t Tester\t\t X :: "<<playerLocationX<<"\n"; cout<<"\t\t "<<playerHealth<<"\t\t\t Y :: "<<playerLocationY<<"\n"; cout<<"--------------------------------------------------------------------------------\n\n"; cout<<"\t\t [m] Move\t [e] Exit\n"; cout<<"\t\t [h] Help\n"; cout<<"--------------------------------------------------------------------------------\n\n"; cout<< msg; cout<<"\n>"; cin>>input; //return 0; } Why not just make this function return the input, rather than be a void?
int BeginGame() { int check;//Used in conjunction with the "rRand" function /*if(FirstRun == 1){ FirstRun = 1;*/ prompt("Welcome to the Vacuus Interface demo!\nThis demo is a simple example of how not to mak a text-based game. At the moment, you can do very little, though, I plan on adding modability very soon.\nIf you require any assitance, please type H into the console to display further information."); while(input != 'e') { //prompt(" "); if(input == 'h') {prompt("This demo was originally meant to serve as an interface demo. Instead,\n I've decided NOT to continue this project, and to move onto a 2D version.\n Before doing so, I plan on adding modability to this demo, so that \nanyone can continue this project - with, or without prior C++ experience.\n\n At the top of the screen, you will see some information on your player, \nincluding health, name & location.\n\n Below that, you will see a list of avaliable commands, each surrounded by '['s, and ']'s. Type a command to get any given effect.\nFinaly, you will see the message box, and command prompt.\n");} if(input == 'm') { playerLocationX+=1; check = ReturnRand_InRange(3,1); if(check == 1){prompt(" ");} if(check == 2){prompt("You've discovered another ship!");} if(check == 3){prompt("You've discovered a planet!");} //cin>>input; } //if(input == 'e'){break;} } return 0; } int main() { int input_int; //Used for the begining only, variable serves the same purpose as the "inout" char., except this one is designed for numeric characters. srand((unsigned int)time( NULL )); SetConsoleTitle("\tVacuus - Interface Demo\t"); cout<<"\t ## ## ### ###### ## ## ## ## ###### \n"; cout<<"\t ## ## ## ## ## ## ## ## ## ## ## ##\n"; cout<<"\t ## ## ## ## ## ## ## ## ## ## \n"; cout<<"\t ## ## ## ## ## ## ## ## ## ###### \n"; cout<<"\t ## ## ######### ## ## ## ## ## ##\n"; cout<<"\t ## ## ## ## ## ## ## ## ## ## ## ##\n"; cout<<"\t ### ## ## ###### ####### ####### ######\n"; cout<<"\n\n\n\t\t\t\t [1] New game.\n\t\t\t\t [2] Exit.\n\n\t\t\t\t >"; cin>>input_int; if(input_int!=1) { return 0; } BeginGame(); return 0; } Both of these functions should just be voids.
int ReturnRand_InRange(int HIGH,int LOW) { return rand() % (HIGH - LOW + 1) + LOW; } Isn't it a little counter-intuitive to have the high value before the low value in the input? Usually it's the other way around.
Anyway, I was looking at this code and I think that with just a little bit of work you could add naming of planets, encountered ships having random names, and *gasp* being able to move backward.
|