Hey, im making a very basic MUD and developing a movement system prototype.
When a player moves into a different room the "location" integer is changed and depending on that number, the while statement will switch to that room. I only made one while statement and im already getting error messages. Please help.
Code:#include <cstdlib> #include <iostream> #include <string> using namespace std; int main(int argc, char *argv[]) { char n, s, w, e; char command; int location = 1; while(location == 1){ cout<<"Obvious Exits: East, West, North, South\nThis is a large damp room\nThere is a steel flaming sword on the ground\n"; cin>>command; if (command == e) {location = 2); else if (command == w) {location = 3}; else if (command == n) {location = 4}; else if (command == s) (location = 5}; else {cout<<"That is not a command\n"; } return EXIT_SUCCESS; }


Reply With Quote


Bookmarks