Skip to content

Commit

Permalink
Bump version to 2.0-RC2
Browse files Browse the repository at this point in the history
  • Loading branch information
msc24x authored May 17, 2020
1 parent bb5c29e commit f783758
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 109 deletions.
108 changes: 52 additions & 56 deletions FRONTEND.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ fstream ScreenV;

void FRONTEND::callout()
{
objMX.placeCursor(30, 23); cout << ' '; for(int t = 0 ; t < 29; t++) cout << LS;
objMX.placeCursor(30, 24); cout << B; objMX.placeCursor(60, 24); cout << B;
objMX.placeCursor(29, 25); cout << B << ' '; objMX.placeCursor(60, 25); cout << B;
objMX.placeCursor(28, 26); cout << B << ' ' << ' '; objMX.placeCursor(60, 26); cout << B;
objMX.placeCursor(27, 27); for(int t = 0 ; t < 33; t++) cout << US;
objMX.placeCursor(30, 23); putchar(' '); for(int t = 0 ; t < 29; t++) putchar(LS);
objMX.placeCursor(30, 24); putchar(B); objMX.placeCursor(60, 24); putchar(B);
objMX.placeCursor(29, 25); putchar(B) ;putchar(' '); objMX.placeCursor(60, 25); putchar(B);
objMX.placeCursor(28, 26); putchar(B); printf(" "); objMX.placeCursor(60, 26);putchar(B);
objMX.placeCursor(27, 27); for(int t = 0 ; t < 33; t++) putchar(US);
}


Expand All @@ -56,28 +56,29 @@ void FRONTEND::makeSpaceinConsole()
objMX.placeCursor(0,0);
for(int s = 0; s< SCREEN_HIEGHT; s++)
{
cout << setfill(' ') << setw(SCREEN_WIDTH) << '\n';
cout << string(SCREEN_WIDTH, ' ');putchar(10); //<< " \n";
//cout << setfill(' ') << setw(SCREEN_WIDTH) << '\n';
}
}

void FRONTEND::printDinoAnywhere(int x, int y, int eyes)
{
// y=28
objMX.placeCursor(x,y++);
cout << LS << B<< B<< B<< B<< B<< B<< LS; objMX.placeCursor(x, y++);
cout << B << B<< B << B;
cout << LS << string(6,B) << LS; objMX.placeCursor(x, y++);
cout << string(4,B);
if(eyes ==0 ) cout << B;
else if(eyes == 1) cout << ' ';
else if(eyes == 2) cout << "\b ";
cout << B<< B<< B<< B; objMX.placeCursor(x, y++);
cout << B<< B<< B<< B << B<< B<< B<< B<< B; objMX.placeCursor(x, y++);
cout << B<< B<< B<< B<< B<< B<< B<< LS; objMX.placeCursor(x-1, y++);
cout << LS << B<< B<< B<< B<< B<< LS; objMX.placeCursor(x-10, y++);
cout << B << " " << LS<< B<< B<< B<< B<< B<< B<< B<< B<< LS; objMX.placeCursor(x-10, y++);
cout << B<< B << " " << LS<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< US<< B; objMX.placeCursor(x-9, y++);
cout << B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< US; objMX.placeCursor(x-9, y++);
cout << US<< B<< B<< B<<B<< B<<B<< B<< B<< B<< B<< B<< B<< US; objMX.placeCursor(x-7, y++);
cout << US<< B<< B<< B<<B<< B<< B<< B<< B<< US; objMX.placeCursor(x-5, y++);
cout << string(4,B); objMX.placeCursor(x, y++);
cout << string(9,B); objMX.placeCursor(x, y++);
cout << string(7,B)<< LS; objMX.placeCursor(x-1, y++);
cout << LS << string(5,B)<< LS; objMX.placeCursor(x-10, y++);
cout << B << " " << LS<< string(8,B)<< LS; objMX.placeCursor(x-10, y++);
cout << B<< B << " " << LS<< string(10,B)<< US<< B; objMX.placeCursor(x-9, y++);
cout << string(14,B)<< US; objMX.placeCursor(x-9, y++);
cout << US<< string(12,B)<< US; objMX.placeCursor(x-7, y++);
cout << US<< string(8,B)<< US; objMX.placeCursor(x-5, y++);
cout << B<< LS << " " << B<< LS;

}
Expand All @@ -94,20 +95,22 @@ void FRONTEND::change_text_color(WORD color)
void FRONTEND::printSurface()
{
objMX.placeCursor(0,37);
for(int x = 0; x < SCREEN_WIDTH; x++){cout << '_';}
cout << string(SCREEN_WIDTH, '_'); //for(int x = 0; x < SCREEN_WIDTH; x++){cout << '_';}
}

void FRONTEND::printEgg(int x, bool stone = false)
{
objMX.placeCursor(x+2, 33);
cout << LS << LS << LS; objMX.placeCursor(x, 34);
cout << LS << B << B << B << B << B << LS; objMX.placeCursor(x, 35);
cout << B << B << US << LS << B << B << B; objMX.placeCursor(x, 36);
cout << B << B << ' ' << B << B << B << B; objMX.placeCursor(x, 37);
cout << B << B << B << B << B << B << B;
if(stone)cout << "___" << B << B << B << B;
if(!stone) {cout << LS <<string(5,B)<< LS; objMX.placeCursor(x, 35);}
if( stone) {cout << LS <<string(4,B) << " "; objMX.placeCursor(x, 35);}
if(stone){ cout << B << B << US << LS << " "; objMX.placeCursor(x, 36);}
if(!stone){ cout << B << B << US << LS << B << B << B; objMX.placeCursor(x, 36);}
cout << B << B << ' ' << string(4,B); objMX.placeCursor(x, 37);
cout << string(7,B);
if(stone)cout << "___" << string(4,B);
objMX.placeCursor(x+1, 38);
cout << US << B << B << B << US;
cout << US << string(3,B)<< US;
}

void FRONTEND::video()
Expand All @@ -122,10 +125,10 @@ void FRONTEND::video()
printDinoAnywhere(14, 28,0);
printEgg(eggVP);

callout(); objMX.placeCursor(32, 25); cout << "Zzzzz...ZZzz... ";
callout(); objMX.placeCursor(32, 25); printf("Zzzzz...ZZzz... ");

this_thread::sleep_for(chrono::seconds(3));
x = 100; y = 5;
x = 100; y = -4;
while(1)
{
makeSpaceinConsole();
Expand All @@ -136,34 +139,30 @@ void FRONTEND::video()

//callout(); objMX.placeCursor(32, 25); cout << "tun , tung tung tung tun...";

if(y >= 35)
{
if(sounds)PlaySound("SB.wav", NULL, SND_SYNC);
printDinoAnywhere(14,28, 2);

break;
}
if(y >= 34) break;


objMX.placeCursor(x,y);
cout<<" ...."; objMX.placeCursor(x,y+1);
cout<<" ......" ; objMX.placeCursor(x,y+2);
cout<< LS<< B<< B<< B<< B<< LS<< '.'; objMX.placeCursor(x,y+3);
cout<< B<< B<< B<< B<< B<< B<< '.'; objMX.placeCursor(x,y+4);
cout<< US<< B<< B<< B<< B<< US; objMX.placeCursor(x,y+5);
y+=4; x-=4;
cout<< LS<<string(4,B)<< LS<< '.'; objMX.placeCursor(x,y+3);
cout<< string(6,B)<< '.'; objMX.placeCursor(x,y+4);
cout<< US<< string(4,B)<< US; objMX.placeCursor(x,y+5);
y+=2; x-=2;
this_thread::sleep_for(chrono::milliseconds(90));

}
if(sounds)PlaySound("MM.wav", NULL, SND_ASYNC);

printEgg(eggVP, 1);
if(sounds)PlaySound("SB.wav", NULL, SND_SYNC);
printDinoAnywhere(14,28, 2);
if(sounds)PlaySound("MM.wav", NULL, SND_ASYNC);

callout(); objMX.placeCursor(32, 25); cout << "Oh! what was that? ";
callout(); objMX.placeCursor(32, 25); printf("Oh! what was that? ");

this_thread::sleep_for(chrono::seconds(1));

x = 50; y = 5;
x = 50; y = 0;
while(1)
{
makeSpaceinConsole();
Expand All @@ -178,24 +177,24 @@ void FRONTEND::video()
cout<<" ......"; objMX.placeCursor(x,y+1);
cout<<" ........."; objMX.placeCursor(x,y+2);
cout<<" .................."; objMX.placeCursor(x,y+3);
cout<< '.'<< LS<< LS<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< LS<< LS<< '.'<< '.'<< '.'<< '.';objMX.placeCursor(x,y+4);
cout<< ' '<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< ' '<< '.'<< '.';objMX.placeCursor(x,y+5);
cout<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< '.';objMX.placeCursor(x,y+6);
cout<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< '.';objMX.placeCursor(x,y+7);
cout<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< '.';objMX.placeCursor(x,y+8);
cout<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< '.';objMX.placeCursor(x,y+9);
cout<< ' '<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B;objMX.placeCursor(x,y+10);
cout<< '.'<< US<< US<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< B<< US<< US;
cout<< '.'<< LS<< LS<< string(11,B)<< LS<< LS<< '.'<< '.'<< '.'<< '.';objMX.placeCursor(x,y+4);
cout<< ' '<<string(15,B)<< ' '<< '.'<< '.';objMX.placeCursor(x,y+5);
cout<< string(17,B)<< '.';objMX.placeCursor(x,y+6);
cout<< string(17,B)<< '.';objMX.placeCursor(x,y+7);
cout<< string(17,B)<< '.';objMX.placeCursor(x,y+8);
cout<< string(17,B)<< '.';objMX.placeCursor(x,y+9);
cout<< ' '<< string(16,B);objMX.placeCursor(x,y+10);
cout<< '.'<< US<< US<< string(11,B)<< US<< US;

y+=1; x-=5;
this_thread::sleep_for(chrono::milliseconds(90));


}

if(sounds)PlaySound("LB.wav", NULL, SND_ASYNC);
if(sounds)PlaySound("LB.wav", NULL, SND_SYNC);

callout(); objMX.placeCursor(32, 25); cout << "I'm sorry my egg . . . Bye!";
callout(); objMX.placeCursor(32, 25); printf("I'm sorry my egg . . . Bye!");

printDinoAnywhere(14,28,2);

Expand Down Expand Up @@ -228,14 +227,14 @@ void FRONTEND::video()
(r == surface && (c >= eggVP && c <= eggVP+4))
|| (r == surface-1 && ((c >= eggVP-1 && c <= eggVP+5) || (c >= eggVP+9 && c <= eggVP+12)))
|| (r == surface-2 && (c >= eggVP-1 && c <= eggVP+5 && c != eggVP+1))
|| (r == surface-3 && (c >= eggVP-1 && c <= eggVP+5))
|| (r == surface-4 && (c >= eggVP-1 && c <= eggVP+5))
|| (r == surface-3 && (c >= eggVP-1 && c <= eggVP+2))
|| (r == surface-4 && (c >= eggVP-1 && c <= eggVP+3))
|| (r == surface-5 && (c >= eggVP+1 && c <= eggVP+3))
)
{
printBlock();
if(r == surface-5 && (c >= eggVP+1 && c <= eggVP+3)) printLS();
if(r == surface-4 && (c == eggVP-1 || c == eggVP+5)) printLS();
if(r == surface-4 && (c == eggVP-1 )) printLS();
if(r == surface-3 && (c == eggVP+1)) printUS();
if(r == surface-3 && (c == eggVP+2)) printLS();
if(r == surface && (c == eggVP || c == eggVP+4)) printUS();
Expand Down Expand Up @@ -307,9 +306,6 @@ void FRONTEND::credits()
objMX.placeCursor(SCREEN_WIDTH/2 - 19, SCREEN_HIEGHT/2 - 1);
cout << "D E V E L O P E D B Y M S C 2 4 X"; objMX.placeCursor(SCREEN_WIDTH/2 - 9, SCREEN_HIEGHT/2 + 1);
cout << "with love using c++"; //cout << "WITH LOVE USING C++";


cin.get();
}

void FRONTEND::printUS()
Expand Down
66 changes: 32 additions & 34 deletions Menu_xtra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ void Menu_xtra::printTitle()

for(int t = 0; t<SCREEN_HIEGHT; t++){cout << setfill(' ') << setw(SCREEN_WIDTH) << '\n';}
placeCursor(SCREEN_WIDTH/2 - 20, SCREEN_HIEGHT/4);
cout <<"_|_|_| _|_|_| _| _| _|_| "; placeCursor(SCREEN_WIDTH/2 - 20, SCREEN_HIEGHT/4 + 1);
cout <<"_| _| _| _|_| _| _| _|"; placeCursor(SCREEN_WIDTH/2 - 20, SCREEN_HIEGHT/4 + 2);
cout <<"_| _| _| _| _| _| _| _|"; placeCursor(SCREEN_WIDTH/2 - 20, SCREEN_HIEGHT/4 + 3);
cout <<"_| _| _| _| _|_| _| _|"; placeCursor(SCREEN_WIDTH/2 - 20, SCREEN_HIEGHT/4 + 4);
cout <<"_|_|_| _|_|_| _| _| _|_| "; placeCursor(SCREEN_WIDTH/2 - 20, SCREEN_HIEGHT/4 + 6);
cout <<" --< THE AGE OF EXTINCTION >-- "; placeCursor(SCREEN_WIDTH - 25, SCREEN_HIEGHT+2);
printf("_|_|_| _|_|_| _| _| _|_| "); placeCursor(SCREEN_WIDTH/2 - 20, SCREEN_HIEGHT/4 + 1);
printf("_| _| _| _|_| _| _| _|"); placeCursor(SCREEN_WIDTH/2 - 20, SCREEN_HIEGHT/4 + 2);
printf("_| _| _| _| _| _| _| _|"); placeCursor(SCREEN_WIDTH/2 - 20, SCREEN_HIEGHT/4 + 3);
printf("_| _| _| _| _|_| _| _|"); placeCursor(SCREEN_WIDTH/2 - 20, SCREEN_HIEGHT/4 + 4);
printf("_|_|_| _|_|_| _| _| _|_| "); placeCursor(SCREEN_WIDTH/2 - 20, SCREEN_HIEGHT/4 + 6);
printf(" --< THE AGE OF EXTINCTION >-- "); placeCursor(SCREEN_WIDTH - 25, SCREEN_HIEGHT+2);

cout <<"build 2.0-rc1-20200510";
printf("build 2.0-rc2-20200514");


objFend.printSurface();
Expand Down Expand Up @@ -100,10 +100,10 @@ void Menu_xtra::mainMenu(int W, int H)
while(!selected)
{
placeCursor(SCREEN_WIDTH/2 - 8 , 2*SCREEN_HIEGHT/3 - 3);
cout << " Play"; placeCursor(SCREEN_WIDTH/2 - 8, 2*SCREEN_HIEGHT/3 - 2);
cout << " Settings"; placeCursor(SCREEN_WIDTH/2 - 8, 2*SCREEN_HIEGHT/3 - 1);
cout << " Help"; placeCursor(SCREEN_WIDTH/2 - 8, 2*SCREEN_HIEGHT/3 );
cout << " Quit";
printf(" Play"); placeCursor(SCREEN_WIDTH/2 - 8, 2*SCREEN_HIEGHT/3 - 2);
printf(" Settings"); placeCursor(SCREEN_WIDTH/2 - 8, 2*SCREEN_HIEGHT/3 - 1);
printf(" Help"); placeCursor(SCREEN_WIDTH/2 - 8, 2*SCREEN_HIEGHT/3 );
printf(" Quit");

selectMech(4);
}
Expand Down Expand Up @@ -141,15 +141,15 @@ void Menu_xtra::settings()
while(!selected)
{
placeCursor(SCREEN_WIDTH/2 - 16, 2*SCREEN_HIEGHT/3 - 5);
cout << " SETTINGS "; placeCursor(SCREEN_WIDTH/2 - 16, 2*SCREEN_HIEGHT/3 - 3);
cout << " Challenge ";
if(difficulty == 2) cout << " Normal ";
if(difficulty == 3) cout << " Hard " ;
if(difficulty == 4) cout << " Nightmare " ; placeCursor(SCREEN_WIDTH/2 - 16, 2*SCREEN_HIEGHT/3 - 2) ;
cout << " Sounds ";
if(sounds == 1) cout << " ON ";
if(sounds == 0) cout << " OFF " ; placeCursor(SCREEN_WIDTH/2 - 16, 2*SCREEN_HIEGHT/3 - 1);
cout << " Back";
printf(" SETTINGS "); placeCursor(SCREEN_WIDTH/2 - 16, 2*SCREEN_HIEGHT/3 - 3);
printf(" Challenge ");
if(difficulty == 2) printf(" Normal ");
if(difficulty == 3) printf(" Hard " );
if(difficulty == 4) printf(" Nightmare " ); placeCursor(SCREEN_WIDTH/2 - 16, 2*SCREEN_HIEGHT/3 - 2) ;
printf(" Sounds ");
if(sounds == 1) printf(" ON ");
if(sounds == 0) printf(" OFF ") ; placeCursor(SCREEN_WIDTH/2 - 16, 2*SCREEN_HIEGHT/3 - 1);
printf(" Back");
selectMech(3, 8);
}
if(sounds)PlaySound("selected.wav", NULL , SND_ASYNC);
Expand All @@ -161,9 +161,9 @@ void Menu_xtra::settings()
while(!selected)
{
placeCursor(SCREEN_WIDTH/2 - 2, 2*SCREEN_HIEGHT/3 - 3);
if(pointingToSubOpt == 1) cout << " Normal >";
if(pointingToSubOpt == 2) cout << "< Hard >";
if(pointingToSubOpt == 3) cout << "< Nightmare ";
if(pointingToSubOpt == 1) printf(" Normal >");
if(pointingToSubOpt == 2) printf("< Hard >");
if(pointingToSubOpt == 3) printf("< Nightmare ");
selectSubMech(3);
}
difficulty = pointingToSubOpt+1;
Expand All @@ -175,8 +175,8 @@ void Menu_xtra::settings()
while(!selected)
{
placeCursor(SCREEN_WIDTH/2 - 2, 2*SCREEN_HIEGHT/3 - 2);
if(pointingToSubOpt == 1) cout << " ON >";
if(pointingToSubOpt == 2) cout << "< OFF ";
if(pointingToSubOpt == 1) printf(" ON >");
if(pointingToSubOpt == 2) printf("< OFF ");
selectSubMech(2);
}
if(sounds)PlaySound("selected.wav", NULL , SND_ASYNC);
Expand All @@ -196,15 +196,13 @@ void Menu_xtra::help()
pointingTo = 1;
selected = false;
placeCursor(SCREEN_WIDTH/2 - 8, 2*SCREEN_HIEGHT/3 - 5);
cout << " HELP "; placeCursor(SCREEN_WIDTH/2 - 8, 2*SCREEN_HIEGHT/3 - 4);
cout << " "; placeCursor(SCREEN_WIDTH/2 - 30, 2*SCREEN_HIEGHT/3 - 3);
cout << " You have the responsibility to save the last dinosaur "; placeCursor(SCREEN_WIDTH/2 - 30, 2*SCREEN_HIEGHT/3 - 2);
cout << " on Earth from extinction. "; placeCursor(SCREEN_WIDTH/2 - 30, 2*SCREEN_HIEGHT/3 - 0);
cout << " Too easy!? You can always change the difficulty in the"; placeCursor(SCREEN_WIDTH/2 - 30, 2*SCREEN_HIEGHT/3 + 1);
cout << " Settings menu. "; placeCursor(SCREEN_WIDTH/2 - 30, 2*SCREEN_HIEGHT/3 + 2);
cout << " P - Pause "; placeCursor(SCREEN_WIDTH/2 - 30, 2*SCREEN_HIEGHT/3 + 3);
cout << " Q - Quit "; placeCursor(SCREEN_WIDTH/2 - 30, 2*SCREEN_HIEGHT/3 + 4);
cout << " SPACE - Jump ";
printf(" HELP"); placeCursor(SCREEN_WIDTH/2 - 30, 2*SCREEN_HIEGHT/3 - 3);
printf("In the Cretaceous age, meteors are showering and you have "); placeCursor(SCREEN_WIDTH/2 - 30, 2*SCREEN_HIEGHT/3 - 2);
printf(" to save the one of the last few dinosaurs from the "); placeCursor(SCREEN_WIDTH/2 - 30, 2*SCREEN_HIEGHT/3 - 1);
printf(" incoming obstacles from going extinct. "); placeCursor(SCREEN_WIDTH/2 - 8, 2*SCREEN_HIEGHT/3 + 1);
printf(" CONTROLS"); placeCursor(SCREEN_WIDTH/2 - 30, 2*SCREEN_HIEGHT/3 + 3);
printf(" P - Pause Q - Quit "); placeCursor(SCREEN_WIDTH/2 - 30, 2*SCREEN_HIEGHT/3 + 4);
printf(" SPACE - Jump Z - AI Mode ");

if(cin.get())
{
Expand Down
5 changes: 3 additions & 2 deletions PrintPaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void PrintPaster::PrinterEngine()
Screen << '0';
}

Screen << jumps << setw(SCREEN_WIDTH-39) << "SCORE : ";
Screen << jumps << string(SCREEN_WIDTH-45, ' ') << "SCORE : ";
for(int z = 0; z < 5-objFend.nofdigits(score/10); z++)
{
Screen << '0';
Expand All @@ -67,7 +67,7 @@ void PrintPaster::PrinterEngine()
{
Screen << '0';
}
Screen << HiJumps << setw(SCREEN_WIDTH-39) << "HI SCORE : ";
Screen << HiJumps << string(SCREEN_WIDTH-45, ' ') << "HI SCORE : ";
for(int z = 0; z < 5-objFend.nofdigits(HiScore); z++)
{
Screen << '0';
Expand Down Expand Up @@ -215,6 +215,7 @@ void PrintPaster::screenDisplay()
if(scr[x] == 'L') {scr[x] = LO_B;}
if(scr[x] == 'U' && scr[x-1] != 'J') {scr[x] = UP_B;}
}
//wprintf(L"%s\n", scr);//
cout << scr << '\n';
}
frame++;
Expand Down
Loading

0 comments on commit f783758

Please sign in to comment.