Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Sterling Mahoney
- //Programming for Visual Artists Final
- //Please don't be disappointed in me, Steve.
- //I'M TRYING MY BEST
- //NOTES FOR WHEN YOU COME BACK TO THIS:
- //YOU'RE WORKING ON THE FATALERROR
- //TEXT ANIMATIONS WON'T APPEAR
- //TRY AND GET SKETCH TO REDRAW
- //GOTTA GET THAT BLACK BOX OVER THE PASSWORD TEXT TOO
- //initialize startscreen
- startScreen s1 = new startScreen();
- //initialize welcomescreen
- welcomeScreen w1 = new welcomeScreen();
- //initalize password function
- password text = new password();
- //cover over password text
- //initialize popup
- popUp p1 = new popUp();
- //penultimate page
- endScreen e = new endScreen();
- //Final event
- fatalError f = new fatalError();
- String words = "USERNAME:";
- String asterisk = "PASSWORD:";
- //Set up millis for timing
- int time = millis();
- int timer = millis();
- int t = millis();
- //count them enter hits
- int counter = 0;
- //I just have the number 50 a lot
- int x = 50;
- void setup() {
- fullScreen(P2D);
- background (0);
- textSize (20);
- fill (0, 234, 0); //Beep boop, computer green!
- } //setup
- void draw() {
- //start screen
- if (counter == 0) {
- time = 0;
- s1.initialize();
- } // if s1
- //welcome screen
- if (counter == 1) {
- background (0);
- w1.initialize();
- } // if w1
- //password start
- if (counter == 2) {
- text.initialize();
- } //if counter 2
- //WARNING POP-UPS ~ THIS WILL GET MESSY
- if (counter == 3) {
- p1.warning1();
- text.initialize();
- if (counter == 4) {
- fill (0);
- rect (0, 215, 2500, 35);
- }
- } //if counter 3
- if (counter == 4) {
- p1.warning2();
- text.initialize();
- if (counter == 5) {
- fill (0);
- rect (0, 215, 2500, 25);
- }
- }
- if (counter == 5) {
- p1.warning3();
- text.initialize();
- if (counter == 6) {
- fill (0);
- rect (0, 215, 2500, 25);
- }
- }
- if (counter == 6) {
- p1.warning4();
- text.initialize();
- if (counter == 7) {
- fill (0);
- rect (0, 215, 2500, 25);
- }
- }
- if (counter == 7) {
- p1.warning5();
- text.initialize();
- }
- if (counter == 8) {
- p1.warning6();
- text.initialize();
- }
- if (counter == 9) {
- p1.warning7();
- text.initialize();
- }
- if (counter == 10) {
- p1.warning8();
- text.initialize();
- }
- if (counter == 11) {
- p1.warning9();
- text.initialize();
- }
- if (counter == 12) {
- p1.warning10();
- text.initialize();
- }
- if (counter == 13) {
- p1.warning11();
- text.initialize();
- }
- if (counter == 14) {
- p1.warning12();
- text.initialize();
- }
- if (counter == 15) {
- p1.warning13();
- text.initialize();
- }
- if (counter == 16) {
- p1.warning14();
- text.initialize();
- }
- if (counter == 17) {
- p1.warning15();
- text.initialize();
- }
- if (counter == 18) {
- p1.warning16();
- text.initialize();
- }
- if (counter == 19) {
- p1.warning17();
- text.initialize();
- }
- if (counter == 20) {
- p1.warning18();
- text.initialize();
- }
- if (counter == 21) {
- p1.warning19();
- text.initialize();
- }
- //endScreen
- if (counter == 22) {
- e.message();
- }
- if (counter ==23) {
- f.colorFlash();
- f.errorRepeat();
- }
- if (counter == 24) {
- //r.finalError ();
- //r.finish ();
- }
- } //draw
- void keyPressed() {
- if (key == ENTER) {
- counter=counter+1;
- } //if
- // The variable "key" always contains the value
- // of the most recent key pressed.
- if ((key >= 'A' && key <= 'z') || key == ' ') {
- words = words + key;
- } //if
- if (counter == 2) {
- key = '*';
- asterisk = asterisk + key;
- } //if
- } //keyPressed
- //Screen following passwork
- class endScreen {
- void message(){
- background (0);
- t = 0;
- if (millis()- t > 1000){
- text(">PASSWORD MUST BE CHANGED EVERY FIVE CALENDAR DAYS",x,x);
- }
- if (millis()- t > 2000){
- text(">ALL NEW PASSWORDS MUST CONTAINS AT LEAST ONE CHARACTER, INTEGER AND SYMBOL",x,100);
- }
- if (millis()- t > 3000){
- text(">PASSWORD MUST BE CHANGED EVERY FIVE CALENDAR DAYS",x,150);
- }
- if (millis()- t > 4000){
- text(">AFTER TWO CONSECUTIVE UNSUCCESSFUL PASSWORD ATTEMPTS, THE ACCOUNT WILL BE REVOKED",x,200);
- }
- if (millis()- t > 5000){
- text(">PASSWORDS DEEMED NOT ROBUST ENOUGH BY THE COMPUTER’S ALGORITHM WILL BE REJECTED",x,250);
- }
- if (millis()- t > 6000){
- text(">WARNING: NEVER, EVER GIVE AWAY YOUR PASSWORD INFORMATION TO ANYONE, SPOUSE INCLUDED",x,300);
- }
- if (millis()- t > 6500){
- textSize (15);
- text(">PRESS ENTER",x,360);
- }
- } //message
- } //endScreen
- //The final page that leads to the reset
- class fatalError {
- void colorFlash (){
- timer = 0;
- rect (0, 0, 1000, 2000);
- fill (0);
- if (millis()- timer > 1000){
- fill (0, 234, 0);
- }
- if (millis()- timer > 1100){
- fill (0);
- }
- if (millis()- timer > 1200){
- fill (0, 234, 0);
- }
- if (millis()- timer > 1300){
- fill (0);
- }
- } //colorFlash
- void errorRepeat (){
- if (millis()- timer > 1400){
- text(">ERROR", x, 25);
- }
- if (millis()- timer > 1500){
- text(">ERROR", x, 50);
- }
- if (millis()- timer > 1600){
- text(">ERROR", x, 100);
- }
- if (millis()- timer > 2000){
- text(">ERROR", x, 125);
- }
- if (millis()- timer > 2100){
- text(">ERROR", x, 150);
- }
- if (millis()- timer > 2200){
- text(">ERROR", x, 175);
- }
- if (millis()- timer > 2300){
- text(">ERROR", x, 200);
- }
- if (millis()- timer > 2450){
- text(">ERROR", x, 210);
- }
- if (millis()- timer > 2500){
- text(">ERROR", x, 250);
- }
- if (millis()- timer > 2800){
- text(">ERROR", x, 262);
- }
- if (millis()- timer > 2950){
- text(">ERROR", x, 300);
- }
- if (millis()- timer > 3000){
- text(">ERROR", x, 350);
- }
- if (millis()- timer > 3100){
- text(">ERROR", x, 400);
- }
- if (millis()- timer > 3200){
- text(">ERROR", x, 425);
- }
- if (millis()- timer > 3350){
- text(">ERROR", x, 450);
- }
- if (millis()- timer > 3500){
- text(">ERROR", x, 460);
- }
- if (millis()- timer > 3600){
- text(">ERROR", x, 475);
- }
- if (millis()- timer > 3650){
- text(">ERROR", x, 500);
- }
- if (millis()- timer > 3700){
- text(">ERROR", x, 550);
- }
- if (millis()- timer > 3800){
- text(">ERROR", x, 557);
- }
- if (millis()- timer > 3900){
- text(">ERROR", x, 600);
- }
- if (millis()- timer > 4000){
- text(">ERROR", x, 650);
- }
- if (millis()- timer > 4550){
- text(">ERROR", x, 675);
- }
- if (millis()- timer > 4600){
- text(">ERROR", x, 700);
- }
- if (millis()- timer > 4700){
- text(">ERROR", x, 725);
- }
- if (millis()- timer > 4850){
- text(">ERROR", x, 750);
- }
- if (millis()- timer > 4900){
- text(">ERROR", x, 775);
- }
- if (millis()- timer > 5000){
- text(">ERROR", x, 800);
- }
- if (millis()- timer > 5100){
- background (0);
- }
- } //error
- } //fatalError
- //FUN PASSWORD THING
- class password {
- void initialize(){
- textSize (20);
- fill (0, 234, 0);
- text(asterisk , x, 235);
- textSize (15);
- text("PRESS ENTER", x, 260);
- } //initialize
- } //password
- //Object where password errors popup!
- //Okay, so for them to work they each have to be their own function
- //I know, there's a way to do this with an array
- //I don't have the patience to figure that out
- class popUp {
- void warning1 (){
- textSize (15);
- if (counter == 3) {
- text(">PASSWORD MUST BE FOURTEEN OR MORE CHARACTERS LONG",x,325);
- }//if1
- } //warning1
- void warning2 (){
- textSize (15);
- if (counter == 4) {
- text(">PASSWORD MUST CONTAIN AT LEAST ONE UPPER-CASE AND ONE LOWER-CASE LETTER",x,350);
- }//if2
- } //warning2
- void warning3 (){
- textSize (15);
- if (counter == 5) {
- text(">PASSWORD MUST CONTAIN AT LEAST ONE NUMERAL",x,375);
- }//if3
- } //warning3
- void warning4 (){
- textSize (15);
- if (counter == 6) {
- text(">PASSWORD MUST CONTAIN ONE NON-ALPHANUMERIC CHARACTER",x,400);
- }//if4
- }//warning4
- void warning5 (){
- textSize (15);
- if (counter == 7) {
- text(">PASSWORD MUST NOT CONTAIN A SPACE",x,425);
- }//if5
- }//warning5
- void warning6 (){
- textSize (15);
- if (counter == 8) {
- text(">PASSWORD MUST CONTAIN INVALID CHARACTER, TABS OR LETTERS USING NON-ENGLISH DIACRITICAL OR ORTHOGRAPHICAL MARKS",x,450);
- }//if6
- }//warning6
- void warning7 (){
- textSize (15);
- if (counter == 9) {
- text(">PASSWORD MUST NOT CONTAIN FORWARD OR REVERSE FRAGMENTS OF FIVE OR MORE CHARACTER OF YOUR FIRST NAME, MIDDLE NAME OR LAST NAME, REGARDLESS OF THE CASE (UPPER OR LOWER) OF THE LETTER.",x,475);
- }//if7
- }//warning7
- void warning8 (){
- textSize (15);
- if (counter == 10) {
- text(">PASSWORD MUST NOT CONTAIN FORWARD OR REVERSE ALPHABETIC SEQUENCES OF FIVE OR MORE LETTERS, REGARDLESS OF THE CASE (UPPER OR LOWER) OF THE LETTER",x,500);
- }//if8
- }//warning8
- void warning9 (){
- textSize (15);
- if (counter == 11) {
- text(">PASSWORD NON-ALPHANUMERIC CHARACTERS MAY NOT BE ARRANGED IN ‘EMOTICON’ FORMAT, E.G. :), ;), <3",x,525);
- }//if9
- }//warning9
- void warning10 (){
- textSize (15);
- if (counter == 12) {
- text(">PASSWORD MUST NOT CONTAIN REPEATED CHARACTERS IN GROUPS OF THREE OR MORE E.G. AAA, 1111",x,550);
- }//if10
- }//warning10
- void warning11 (){
- textSize (15);
- if (counter == 13) {
- text(">PASSWORD MUST NOT CONTAIN MORE THAN TWO SEQUENTIAL CHARACTERS OF USER’S ACCOUNT NAME",x,575);
- }//if11
- }//warning12
- void warning12 (){
- if (counter == 14) {
- textSize (15);
- text(">PASSWORD MUST NOT CONTAIN MORE THAN TWO SEQUENTIAL CHARACTER OF LOG-IN ID",x,600);
- }//if12
- }//warning12
- void warning13 (){
- if (counter == 15) {
- textSize (15);
- text(">PASSWORD MUST NOT CONTAIN MORE THAN TWO SEQUENTIAL CHARACTERS OF EMAIL ADDRESS",x,625);
- }//if13
- }//warning13
- void warning14 (){
- textSize (15);
- if (counter == 16) {
- text(">PASSWORD MUST NOT CONTAIN MORE THAN TWO SEQUENTIAL CHARACTERS OF INITIALS",x,650);
- }//if14
- }//warning14
- void warning15 (){
- textSize (15);
- if (counter == 17) {
- text(">PASSWORD MUST NOT CONTAIN MORE THAN TWO SEQUENTIAL CHARACTERS OF FIRST, LAST OR MIDDLE NAME",x,675);
- }//if15
- }//warning15
- void warning16 (){
- textSize (15);
- if (counter == 18) {
- text(">PASSWORD MUST NOT CONTAIN MORE THAN THREE SEQUENTIAL NUMBERS OF USER’S BIRTH YEAR",x,700);
- }//if16
- }//warning 16
- void warning17 (){
- textSize (15);
- if (counter == 19) {
- text(">PASSWORD MUST NOT CONTAIN MORE THAN THREE SEQUENTIAL CHARACTERS OF USER’S BIRTH DATE DD/MM/YYYY OR MM/DD/YYYY FORMAT",x,725);
- }//if17
- }//warning17
- void warning18 (){
- textSize (15);
- if (counter == 20) {
- text(">PASSWORD MUST NOT CONTAIN ANY COMMON WORDS OR PROPER NAMES OF FIVE OR MORE CHARACTERS, REGARDLESS OF CASE (UPPER OR LOWER) OF THE LETTERS",x,750);
- }//if18
- }//warning18
- void warning19 (){
- textSize (15);
- if (counter == 21) {
- textSize (20);
- text(">PASSWORD SET",0,825);
- text(">PRESS ENTER",0,850);
- }//if19
- }//warning19
- }//popUp
- class restart {
- void finalError (){
- if (millis()- timer > 7000){
- text(">A FATAL ERROR HAS OCCURED", 0, x);
- text(">INITIALIZING SYSTEM REBOOT...", x, 100);
- }
- if (millis()- timer > 9000){
- background (0);
- }
- v//oid finish (){
- if (counter == 25) {
- redraw();
- } //if
- } //finish
- } //restart
- //Let's get ready to rumble
- class startScreen {
- void initialize() {
- if (millis()- time > 2000){
- text(">STARTUP TEST (1.2)", x, x);
- } //if 2000
- if (millis()- time > 3000){
- text(">RAM SIZE = 512K", x, 100);
- } //if 3000
- if (millis()- time > 5000) {
- text(">BOOTING FROM FLOPPY", x, 150);
- } //if 5000
- if (millis()- time > 5500){
- text(">BOOTING CPU", x, 200);
- } //if 5500
- if (millis()- time > 6500){
- text(">PRESS ENTER", x, 250);
- } //if 5500
- } //void initialize
- } //class startScreen
- // Welcome/main screen
- class welcomeScreen {
- void initialize() {
- textSize (20);
- if (millis()- time > 7500){
- text(">WELCOME TO YOUR NEW COMPUTER", 0, x);
- }
- if (millis()- time > 9000){
- text(">TO ENSURE THE SECURITY OF YOUR FILES WE ASK YOU TO CREATE A USERNAME AND PASSWORD", x, 100);
- }
- if (millis()- time > 10500){
- textSize (15);
- text("PLEASE ENTER YOUR FIRST NAME", x, 150);
- textSize (20);
- text(words , x, 175);
- textSize (15);
- text("PRESS ENTER", x, 200);
- }
- } //initialize
- } //welcomeScreen
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement