Hello, I created a text game creator but it does not seem to work. Can somebody explain what is going wrong and any tips?
//
// main.cpp
// Text creator 3
//
// Created by Olivier on 9/30/12.
// Copyright (c) 2012 Olivier. All rights reserved.
//
It automatically ends program once it displays the middle, it doesnt wait for getline. Do you have any tips or suggestions? This is my third try for this program and I dont want to mess up. Thanks a lot though!
It worked, just need to clear a bit up.
//
// main.cpp
// Text creator 3
//
// Created by Olivier on 9/30/12.
// Copyright (c) 2012 Olivier. All rights reserved.
//
{
cout << "Name of game: ";
getline(cin,nameofgame);
cout << "Name of Author: ";
getline(cin,name);
cout << "Enter beginning of Text adventure: ";
getline(cin,start);
cout << "One answer to " << start;
cout << ": ";
getline(cin,startsolution1);
cout << "Another answer to " << start;
cout << ": ";
getline(cin,startsolution2);
cout << "Enter middle of the Text adventure if player types in " << startsolution1;
cout << ": ";
getline(cin,middle1);
cout << "Enter middle of Text adventure if player types " << startsolution2;
cout << ": ";
getline(cin,middle2);
cout << "One answer to " << middle1;
getline(cin,middle1solution1);
cout << "Another answer to " << middle1;
getline(cin,middle1solution2);
cout << "Enter the end of the game if player types " << middle1solution1;
cout << ": ";
getline(cin,end1);
cout << "Enter the end of the game if player types " << middle1solution2;
cout << ": ";
getline(cin,end2);
gamestart();
}
void gamemiddle1()
{
cout << middle1;
std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' );
getline(cin,middle1solution);
if (middle1solution == end1)
{
gameend1();
}