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"Header.h"
bool dontexit(int x)
{
if (x == 1)
{
return true;
}
else
{
return false;
}
}
bool finance(int x)
{
bool gos = true;
if (x < 0)
{
cout << "Your City is Bankrupt ! Better Luck Next Time" << endl;
bool played1 = PlaySound(TEXT("GameOver.wav"), NULL, SND_SYNC);
gos = false;
return gos;
}
else
{
return gos;
}
}
void finance1()
{
if (hours % 30 == 0)
{
sum = sum + 800000;
}
}
void timer()
{
while (true) {
finance1();
if (finance(sum) == true)
{
Sleep(1000);
seconds = seconds + 60;
if (seconds == 60) {
minutes = minutes + 60;
if (minutes == 60) {
hours++;
minutes = 0;
}
seconds = 0;
}
}
}
}
void player()
{
while (true)
{
bool played = PlaySound(TEXT("gamemusic.wav"), NULL, SND_SYNC);
}
}
void GameEngine()
{
thread t1(GameCommandEngine);
thread t2(player);
thread t3(timer);
thread t4(GameCommandEngine);
thread t5(player);
thread t6(timer);
thread t7(GameCommandEngine);
thread t8(player);
thread t9(timer);
thread t10(GameCommandEngine);
thread t11(player);
thread t13(timer);
t1.join();
t2.join();
t3.join();
t4.join();
t5.join();
t6.join();
t7.join();
t8.join();
t9.join();
t10.join();
t11.join();
t13.join();
}
int main()
{
cout << welcometext(5) << endl;
Tutorials(3);
GameEngine();
return 0;
}