Okay.. i got the map boundries plus an item.
But on
line 111: parse error before 'if'
line 26: confused by earlier errors, bailing out
Code:/******************************************************************** *Zachs first CPP game. Kind of a RPG. Text based. ********************************************************************/ #include <iostream.h> #include <stdlib.h> #include <conio.h> //allows getch() using namespace std; //allows cout instead of std::cout int player_location_Y = 0; /* Player*/ int player_location_X = 0; /* Start*/ int health = 100; //player health int health_potion = 10; //gives ten health int end_game = 100; // timer: if zero, game ends int points = 0; //score int bread = 0; //food char input; int main() { char name[20]; cout << "Please enter your name: "; cin >> name; cout << "\nHello " << name << "Welcome to my quest!\n"; cout << "You must venture throught this maze avoiding traps\n"; getch(); do //start { if (player_location_Y == 25) { cout << "That way is blocked!\n"; player_location_Y--; getch(); } else if (player_location_Y == -25) { cout << "That way is blocked!\n"; player_location_Y++; getch(); } else if (player_location_X == 25) { cout << "That way is blocked!\n"; player_location_Y--; getch(); } else if (player_location_X == -25) { cout << "That way is blocked!\n"; player_location_Y++; getch(); } end_game--; if (end_game == 0) { system("cls"); cout << "GAME OVER\n"; system("pause"); return 0; } system("cls"); cout <<"North (1)\nSouth (2)\nEast (3)\nWest (4)\n\n"; cin >>input; cout <<"\n"; if (input == 'Q' || input == 'q') { system("cls"); return 0; } if (input == 'I' || input == 'i') { cout <<"North (1)\nSouth (2)\nEast(3)\nWest (4)\nQuit (Q)\nUse Heal (H)\n"; cout <<"Life (L)\nPoints (P)\n"; } if (input == 'L' || input == 'l') { cout <<"Health is "<<health<<"\n\n"; } if (input == 'P' || input == 'p') { cout <<"Points are "<<points<<"\n\n"; } if (input == '1') { player_location_Y = player_location_Y++; } if (input == '2') { player_location_Y = player_location_Y--; } if (input == '3') { player_location_X = player_location_X++; } if (input == '4') { player_location_X = player_location_X--; } } if (player_location_y == 7 || player_location_x == 3) //location of bread { if (bread == 0) { cout << "You have found a loaf of bread! +20 time!\n" end_game = end_game + 20; } else if (bread == 1) { cout << "There are bread crumbs here."; } } }



LinkBack URL
About LinkBacks



Oh, and just in case, not sure if it matters but at the beginning your comment starts with "/ *" instead of "/*".