Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int[] start = {16,9,7,6,7,9,12,11,8,10,9,7,4,6,7,8,2,2,2,1,2,2,3,4,3,0,0,0};
- int[] toadd = {0,0,13,0,8,0,6,0,5,7,8,0,0,21,17,0,2,2,2,3,2,1,2,2,2,6,6,6};
- String[] names ={"Aarex","Arsenii Ivanov","Baris","ChromaticGamer","Spyonclear","Dima Dino","Dogman Super Fan","DR Paradox","Ege ve Tayfasi HD","Eggman Games","Forest Whispers","Generic Username","Glosswired","GMM","Minderia","Nebula","Moises Martinez","Nermal Cat","Nirvana Supermind","Novaya Studia Uchastnika","Saturn 24","SokolerC Computers","Sonic Le Geek","SITWGOAT","Spriteclad","Talking Hank tAL","Various77","yta"};
- int[] waias = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27};
- int[] waiae = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27};
- boolean[] taken = {false,false,false,false,
- false,false,false,false,false,false,false,false,
- false,false,false,false,false,false,false,false,false,false,false,false,false,false,false,false};
- int timer, maxScore, x, y;
- int[][] colors = {{255,0,255},{120,0,255},{210,180,140},{255,120,0},{120,0,255},{210,180,140},{255,120,0},{0,255,0},{255,0,0},{0,120,255},{202,145,222},{255,255,0},{130,65,0},{120,120,120},{0,30,145},{120,120,0},{255,100,255},{0,255,255},{0,145,0},{255,44,255},{0,55,255},{0,220,0},{255,100,255},{0,255,255},{0,145,0},{255,44,255},{0,55,255},{0,220,0}};
- String[] after = {"st","nd","rd","th","th","th",
- "th","th","th","th","th","th","th","th","th","th","th","th","th","th",
- "st","nd","rd","th","th","th","th"};
- PFont font;
- PFont font2;
- int margin = 100;
- float perc = 0;
- void setup(){
- font = loadFont("AppleGaramond-25.vlw");
- font2 = loadFont("AppleGaramondLight-25.vlw");
- size(1280,720);
- for(int i = 0; i < 28; i++){
- int record = 0;
- int recordHolder = 0;
- for(int j = 27; j >= 0; j--){
- if(start[j] >= record && !taken[j]){
- record = start[j];
- recordHolder = j;
- }
- }
- taken[recordHolder] = true;
- waias[recordHolder] = i;
- }
- for(int i = 0; i < 28; i++){
- taken[i] = false;
- }
- for(int i = 0; i < 28; i++){
- int record = 0;
- int recordHolder = 0;
- for(int j = 27; j >= 0; j--){
- if(start[j]+toadd[j] >= record && !taken[j]){
- record = start[j]+toadd[j];
- recordHolder = j;
- }
- }
- taken[recordHolder] = true;
- waiae[recordHolder] = i;
- if(i == 0) maxScore = record;
- }
- textFont(font,40);
- noStroke();
- frameRate(60);
- }
- void draw(){
- background(0);
- if(timer < 1200){
- fill(80);
- rect(0,0,margin,height);
- timer++;
- textAlign(LEFT);
- fill(255);
- for(int i = 0; i < 28; i++){
- text((i+1)+after[i],margin-53,22+25*i);
- }
- if(timer < 480){
- perc = max((float(timer)-180)/300,0);
- }else{
- perc = min(max((float(timer)-480)/300,0),1);
- perc = -cos(perc*PI)/2+0.5;
- }
- for(int j = 0; j < 28; j++){
- fill(colors[j][0],colors[j][1],colors[j][2]);
- if(timer < 480){
- x = int(1020*(start[j]+float(toadd[j])*perc)/maxScore);
- y = 25*waias[j];
- }else{
- x = int(1020*(start[j]+toadd[j])/maxScore);
- y = int((waias[j]+(float(waiae[j])-float(waias[j]))*perc)*25);
- }
- rect(margin,5+y,x,20);
- textAlign(LEFT);
- text(names[j],margin+x+5,24+y);
- fill(0);
- textAlign(RIGHT);
- if(timer < 480){
- text(addCommas(round((start[j]+toadd[j]*perc))),margin+x,24+y);
- }else{
- text(addCommas(start[j]+toadd[j]),margin+x,22+y);
- }
- if(waiae[j] >= 20){
- fill(255,25,0);
- textFont(font2,24);
- textAlign(LEFT);
- text("He fired!",names[j].length()*20+130+x,26+y);
- textFont(font,20);
- }
- }
- //saveFrame("images\\####.png");
- }
- }
- String addCommas(int n){
- String s = n+"";
- String output = "";
- for(int i = 0; i < s.length(); i++){
- if(i >= 1 && (s.length()-i)%3 == 0){
- output = output+",";
- }
- output = output+s.charAt(i);
- }
- return output;
- }
Add Comment
Please, Sign In to add comment