Let's write a simple text-based rpg(role playing game) in C++. This game will be completed through a series of posts, each post working on a different part of the game, I will post the whole game's source code and the executable when the game is finished. Until then I will be posting as the game development progresses.
So this is the first part of the game, the Main Menu.... It doesn't actually do anything yet but I've got to start from somewhere.. It is a pretty simple program that prints all the possible choices given to the user numbered from 0 to 2.
Source Code:
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
cout << "\t \t Welcome to My-Game!" << endl;
cout << "\t Please choose one of the options below: " << endl;
cout << "\t 1)New Game " << endl;
cout << "\t 2)Load Game " << endl;
cout << "\t 0)Exit " << endl << endl;
cout << "Choice: ";
int answer=0;
cin >> answer;
return 0;
}
Δεν υπάρχουν σχόλια:
Δημοσίευση σχολίου