Compare commits

...

4 Commits
master ... dev

Author SHA1 Message Date
Justin bb8bc40c13 Cleaned up the code 2025-05-11 02:15:36 -05:00
Justin 0737ed92a8 Changed the items to static that was need to be. 2025-05-10 23:54:16 -05:00
Justin 4f60b29fc4 Working on entering intro text 2025-05-10 23:06:15 -05:00
Justin 657b97c4a8 Working on the typing output. 2025-05-10 22:48:06 -05:00
8 changed files with 50 additions and 25 deletions

View File

@ -7,7 +7,7 @@ using namespace std;
class Intro {
public:
void mainIntro();
static void mainIntro();
private:
};

View File

@ -1,4 +1,5 @@
#include <iostream>
#include "intro.h"
#include "title.h"
#include <cstdlib>
using namespace std;

View File

@ -1,8 +1,13 @@
#include <chrono>
#include <string>
#include <iostream>
#include <cstring>
#include <thread>
using namespace std;
class Sleep{
public:
void delay(int milliseconds);
static void delay(int milliseconds);
static void type(string text);
};

View File

@ -1,10 +1,12 @@
#include <iostream>
#include <unistd.h>
#include "include/print.h"
#include "include/sleep.h"
using namespace std;
class Title{
private:
protected:
public:
void mainTitle();
static void mainTitle();
};

View File

@ -1,6 +1,12 @@
#include "include/intro.h"
void Intro::mainIntro(){
cout << "The world didn't end with a bang. It ended with a groan.. and the scratching of death fingers against steel shutters." << endl;
std::this_thread::sleep_for(std::chrono::milliseconds(3000));
int time = 1000;
cout << endl;
cout << endl;
Sleep::type("");
Sleep::delay(time);
Sleep::type("The world didn't end with a bang. It ended with a groan.. and the scratching of death fingers against steel shutters.");
Sleep::delay(time);
Sleep::type("Pete used to sell shotgun, slug, and survival tips to deer hunters and doomsday preppers out of his rundown gun store ");
}

View File

@ -1,9 +1,8 @@
#include "include/main.h"
int main (){
Title title;
title.mainTitle();
Intro intro;
intro.mainIntro();
system("clear");
Title::mainTitle();
Intro::mainIntro();
return 0;
}

View File

@ -8,3 +8,18 @@ void Sleep::delay(int milliseconds){
// Do nothing, just wait
}
}
void Sleep::type(string text){
int a = text.size();
char* charArray = new char[a+1];
strcpy(charArray, text.c_str());
int i = 0;
int time = 300;
while(i < a+1){
std::this_thread::sleep_for(std::chrono::milliseconds(time));
cout << charArray[i] << flush;
i++;
}
cout << endl;
delete[] charArray;
}

View File

@ -1,21 +1,18 @@
#include "include/title.h"
#include "include/print.h"
void Title::mainTitle(){
int s = 2000;
Print print;
print.println("███████╗██╗ ██╗ ██████╗ ████████╗ ██████╗ ██╗ ██╗███╗ ██╗ ██████╗ ███████╗████████╗███████╗");
usleep(s);
print.println("██╔════╝██║ ██║██╔═══██╗╚══██╔══╝██╔════╝ ██║ ██║████╗ ██║ ██╔══██╗██╔════╝╚══██╔══╝██╔════╝");
usleep(s);
print.println("███████╗███████║██║ ██║ ██║ ██║ ███╗██║ ██║██╔██╗ ██║ ██████╔╝█████╗ ██║ █████╗ ");
usleep(s);
print.println("╚════██║██╔══██║██║ ██║ ██║ ██║ ██║██║ ██║██║╚██╗██║ ██╔═══╝ ██╔══╝ ██║ ██╔══╝ ");
usleep(s);
print.println("███████║██║ ██║╚██████╔╝ ██║ ╚██████╔╝╚██████╔╝██║ ╚████║ ██║ ███████╗ ██║ ███████╗");
usleep(s);
print.println("╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚══════╝ ╚═╝ ╚══════╝");
int time = 700;
cout << "███████╗██╗ ██╗ ██████╗ ████████╗ ██████╗ ██╗ ██╗███╗ ██╗ ██████╗ ███████╗████████╗███████╗" << endl;
Sleep::delay(time);
cout << "██╔════╝██║ ██║██╔═══██╗╚══██╔══╝██╔════╝ ██║ ██║████╗ ██║ ██╔══██╗██╔════╝╚══██╔══╝██╔════╝" << endl;
Sleep::delay(time);
cout << "███████╗███████║██║ ██║ ██║ ██║ ███╗██║ ██║██╔██╗ ██║ ██████╔╝█████╗ ██║ █████╗ " << endl;
Sleep::delay(time);
cout << "╚════██║██╔══██║██║ ██║ ██║ ██║ ██║██║ ██║██║╚██╗██║ ██╔═══╝ ██╔══╝ ██║ ██╔══╝ " << endl;
Sleep::delay(time);
cout << "███████║██║ ██║╚██████╔╝ ██║ ╚██████╔╝╚██████╔╝██║ ╚████║ ██║ ███████╗ ██║ ███████╗" << endl;
Sleep::delay(time);
cout << "╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚══════╝ ╚═╝ ╚══════╝" << endl;
}