I recently found a large amount of tutorials to make text based RPG's. I am new at programming but have always wanted to learn and figured this would be a good tool. Anyway, I have ran into my first major problem. I kind of understand what's wrong but I am too inexperienced to fix the problem myself. Please Advise. EDIT: I know I should not place in the whole code as a wall of text isn't what people want to see, the only reason I did is because I am unbelievable new at this and am a little unsure as to what you need to see to be able to help me.
Code:
#include "Library.h"
// SUBURBS
void Motel(PLAYER*);
bool Suburbs(PLAYER* player)
{
int choice = 0;
while(choice != 5);
{
cout <<"\n\nThe Suburbs\n\nWelcome to the 'Burbs, homie. The suburbs is the place to be for all you need.\nCheck out the PAWN SHOP for all your weapons and accessories, swing by\nthe CLINIC to beat down anything that might be crawlin' (gross), or rest\neasy at the local MOTEL complete with your very own 'massage therapist' in\nevery room\n\n";
cout <<"Where you headed?\n";
cout <<"1:Motel\n";
cout <<"2:Clinic\n";
cout <<"3:Pawn Shop\n";
cout <<"4:Check Stats\n";
cout <<"5:Outta Here\n";
cout <<">";
cin >> choice;
cout << endl;
switch (choice)
{
case 1:
{
Motel(player);
break;
}
case 2:
{
//Clinic();
break;
}
case 3:
{
//PawnShop();
break;
}
case 4:
{
//Stats();
break;
}
default: break;
}
{
return true;
}
void Motel(PLAYER* player);
{
cout <<"\n\nYou walk into a seedy Motel filled with 'interesting' people. As you make\nyour way to your room, you are greeted by an overly-friendly woman\nholding a riding crop and a pare of sunglasses. Make your move, homie!\n\n";
char answer[5];
answer[0] = 'u';
while (answer[0] != 'p' || answer != 'l')
{
cout <<"PAY your dues ($10) or LEAVE quick?";
cin >> answer;
}
cout << endl;
if (answer[0] == 'p')
{
if (player->GetGold() > 9)
{
player->SpendGold(10);
cout <<"\n\nDamn, you need that! It's amazing how many different uses you can\nfind for a phone cord. (HP and MP fully restored)";
player->SetHealth(player->GetMaxHealth());
player->SetMana(player->GetMaxMana());
}
else
{
cout <<"\n\nLooks like you're outta funds bro!\nCome back when you've got some cash!\n\n";
wait();
answer[0] = 'n';
}
}
if (answer[0] == 'n')
{
cout <<"\n\nThe Motel is definitely a place to remember to come back to,\nbut you've got stuff to do so let's get on with it!\n\n";
wait();
}
}
ERRORS: The first 2 errors are on line 67, the last is on the last line but it when I double click to take me to that line, it brings me to the beginning of the document.
Code:
Suburbs.cpp(67) : error C2446: '!=' : no conversion from 'int' to 'char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Suburbs.cpp(67) : error C2040: '!=' : 'char [5]' differs in levels of indirection from 'int'
Suburbs.cpp(98) : fatal error C1075: end of file found before the left brace '{' at 'Suburbs.cpp(14)' was matched