Working on the typing output.
This commit is contained in:
parent
f5b2925bdf
commit
657b97c4a8
|
@ -1,8 +1,13 @@
|
|||
#include <chrono>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
#include <thread>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Sleep{
|
||||
public:
|
||||
void delay(int milliseconds);
|
||||
|
||||
void type(string text);
|
||||
};
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
#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));
|
||||
Sleep sleep;
|
||||
int time = 2000;
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
#include "include/title.h"
|
||||
#include "include/print.h"
|
||||
|
||||
#include "include/sleep.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("╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═╝ ╚══════╝ ╚═╝ ╚══════╝");
|
||||
Sleep sleep;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue