Boomer-Aus
05-04-2010, 11:05 AM
Well me and my friend are starting to learn C++ and are making a game we have 2 problems
1. its a choice game so if you choose a choice you create a path and it can vary were going to put a raiting (e.g your a coward, hero) and some other stuff but our major problem is we have made the code were the player puts the input in but for example if the player follows C) we want him/her to follow that path and have diffrent choices depending on the choice he/she has previously made so can anyone help me to get a refrence link to a code or tutorial or even on the forum
2. This problem is kind of.......annoying once the player has made a choice a text appears depending on what he/she did but it only stays on screen for 0.7 seconds (to be exact lol) and the program exits so is their any possible help with that?
if anyway can give me a bit of help that would be great i know the first one is kind of hard to get a refrence to a code etc but we have tried and we don't exactly know the name of the code and can't find it via google
Edit:
Here's the code i have only worked on it for about 4 hours total and its my first code so it maybe defective.........
[Code]
// 5.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"{
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
#include <iostream>
#include <string>
using namespace std;
int main(){
int a;
#include <iostream>
#include <string>
using namespace std;
int main ()
cout << "Get out of your foxhole soldier unless you want to Die get the hell out of there!!!\n";
cout << "1) stay in your foxhole \n";
cout << "2) Run out of your foxhole\n";
cout << "3) follow the LT\n";
cout << "Enter a choice: ";
cin >> a;
switch (a){
case 1:
cout << "A barrage of motars hit around you, you hold your head down you think about your girlfriend back home suddenly you hear the whizz of motars coming a few hitting nearby you repeat to yourself ''I can't die i can't die!!!!''sundenly a motar hit's and your life ends the last thing you think about is maybe i should of followed the LT ";
break;
case 2:
cout << "you run out of your foxhole the lt here's you and yells come over there the next image you see is the LT dead hit by a motar half of him in a foxhole the other half crawling and dies, you see a medic he's asking what your name is you reply ... he replys copearl ... help me get some wounded and get them the hell out of here!";
break;
case 3:
cout << "you follow the LT he asks what is your name coperal you reply ... ok!!!!! coperal ... they are firing motars instead of 88s it seems that the raid on their supply depot has shrivled there defence i need you to spot for me so i can take the motars out just don't get yourself killed!";
break;
default:
cout << "Not a valid entry...";
break;
[Code]
1. its a choice game so if you choose a choice you create a path and it can vary were going to put a raiting (e.g your a coward, hero) and some other stuff but our major problem is we have made the code were the player puts the input in but for example if the player follows C) we want him/her to follow that path and have diffrent choices depending on the choice he/she has previously made so can anyone help me to get a refrence link to a code or tutorial or even on the forum
2. This problem is kind of.......annoying once the player has made a choice a text appears depending on what he/she did but it only stays on screen for 0.7 seconds (to be exact lol) and the program exits so is their any possible help with that?
if anyway can give me a bit of help that would be great i know the first one is kind of hard to get a refrence to a code etc but we have tried and we don't exactly know the name of the code and can't find it via google
Edit:
Here's the code i have only worked on it for about 4 hours total and its my first code so it maybe defective.........
[Code]
// 5.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"{
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
#include <iostream>
#include <string>
using namespace std;
int main(){
int a;
#include <iostream>
#include <string>
using namespace std;
int main ()
cout << "Get out of your foxhole soldier unless you want to Die get the hell out of there!!!\n";
cout << "1) stay in your foxhole \n";
cout << "2) Run out of your foxhole\n";
cout << "3) follow the LT\n";
cout << "Enter a choice: ";
cin >> a;
switch (a){
case 1:
cout << "A barrage of motars hit around you, you hold your head down you think about your girlfriend back home suddenly you hear the whizz of motars coming a few hitting nearby you repeat to yourself ''I can't die i can't die!!!!''sundenly a motar hit's and your life ends the last thing you think about is maybe i should of followed the LT ";
break;
case 2:
cout << "you run out of your foxhole the lt here's you and yells come over there the next image you see is the LT dead hit by a motar half of him in a foxhole the other half crawling and dies, you see a medic he's asking what your name is you reply ... he replys copearl ... help me get some wounded and get them the hell out of here!";
break;
case 3:
cout << "you follow the LT he asks what is your name coperal you reply ... ok!!!!! coperal ... they are firing motars instead of 88s it seems that the raid on their supply depot has shrivled there defence i need you to spot for me so i can take the motars out just don't get yourself killed!";
break;
default:
cout << "Not a valid entry...";
break;
[Code]