Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include <stdlib.h>
- using namespace std;
- int main(){
- cout << "<=======|==o RPG by zachdyer o==|========>\n" << endl;
- cout << "Enter a menu number." << endl;
- cout << "1. New Game" << endl;
- int select;
- cin >> select;
- if(select == 1){
- //Enter character name
- char name[20];
- cout << "Choose your character name" << endl;
- cin >> name;
- bool running = true;
- int room = 1;
- while(running == true){
- //Begin quest
- switch(room){
- case 1:
- cout << "You are in a room. There is a door to your left and a staircase going up." << endl;
- cout << "1. Go left" << endl;
- cout << "2. Go upstairs" << endl;
- cout << "3. Exit" << endl;
- cin >> select;
- if(select == 1){
- room = 2;
- }
- else if(select == 2){
- room = 3;
- }
- else if(select == 3){
- running = false;
- }
- break;
- case 2:
- cout << "You are in a room. There is a chest in front of you. There is a door behind you." << endl;
- cout << "1. Open chest" << endl;
- cout << "2. Go in door" << endl;
- cout << "3. Exit" << endl;
- cin >> select;
- if(select == 1){
- cout << "You opened the chest." << endl;
- }
- else if(select == 2){
- room = 1;
- }
- else if(select == 3){
- running = false;
- }
- break;
- case 3:
- cout << "You are in a room. There is a bed in the room. There are stairs going down." << endl;
- cout << "1. Go to bed" << endl;
- cout << "2. Go downstairs" << endl;
- cout << "3. Exit" << endl;
- cin >> select;
- if(select == 1){
- cout << "You go to bed." << endl;
- }
- else if(select == 2){
- room = 1;
- }
- else if(select == 3){
- running = false;
- }
- break;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement