Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#include<iostream>
#include"mainn.h"
#include<vector>
#include<Windows.h>
#include<string>
#include<iterator>
using namespace std;
/// Global variables
std::string playerName = " ", cityName = " " ;
int minPopulation = 0, maxPopulation = 0, population = 0, minHappiness = 0, maxHappiness = 100, happiness = 0, minPolution = 0, maxPolution = 100, polution = 0, minMoney = 0, money = 0 ;
void loadingmaker()
{
cout<<"Loading";
Sleep(750);
cout<<".";
Sleep(750);
cout<<".";
Sleep(750);
cout<<"."<<endl;
}
/// Moagy's bit
void introScreen() {
/* Player choosing their name and city name */
cout << "Please enter your name Mayor: " ;
cin >> playerName ;
cout << "Hello Mayor " + playerName + ", what would you like to call your city?" ;
cin >> cityName ;
}
void mainScreen() {
Sleep(200);
cout << "Loading Game.\n" ;
Sleep( 200 ) ;
system( "cls" ) ;
cout << "Loading Game..\n";
Sleep( 200 ) ;
system( "cls" ) ;
cout << "Loading Game...\n";
Sleep( 200 ) ;
system( "cls" ) ;
/// This is an idea for the top of the HUD
cout << "Mayor " << playerName << " City Name: " << cityName << " Money: " << money << " Population: " << population << " Happiness: " << happiness <<
}
/// End of Moagy's bit
string welcometext()
{
string ab;
ab="Welcome to Anoroc City Builder! You have been appointed as the mayor of the city. Let us start by building our city's Townhall\nTownhall is your workspace from where you govern the city. It is also a place that stores the current statistics of your city and its citizens\n\nYou currently hold 5000000 in your Treasury ., make good decisions to keep the City Happiness meter above 20%";
return ab;
}
void Tutorials(int num)
{
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(h,FOREGROUND_BLUE | FOREGROUND_INTENSITY);
string City_costs="-->Small Apartments :$3,000,000\n-->Medium Apartments:$10,000,000\n-->Large Apartments:$50,000,000\n-->Cost/roadblock=$500";
string Roadbrief,ApartmentBrief,CharacterBrief;
bool Townhall_NotBuilt=true;
while (Townhall_NotBuilt)
{
string x;
cout<<"-Enter townhall to build your townhall free of cost"<<endl;
cin>>x;
if (x=="townhall")
{
loadingmaker();
cout<<"-Congratulations ! You have successfully build a Townhall."<<endl;
cout<<"Let me give you a brief about the city and its associated costs"<<endl;
SetConsoleTextAttribute(h,FOREGROUND_GREEN | FOREGROUND_INTENSITY);
cout<<City_costs<<endl;
cout<<"--Remember that your Citizens give you 20% tax for the services they use and income they earn per month."<<endl;
Townhall_NotBuilt=false;
}
else
{
cout<<"Oh Chief ! Invalid input."<<endl;
}
}
}
int main()
{
cout<<welcometext()<<endl;
Tutorials(3);
return 0;
}