float[] changingLocations = {26, 74, 122, 170, 218, 266, 314, 362, 410, 458, 506, 554, 602, 650, 698, 746, 794, 842}; int[] newLocations = {842, 794, 746, 698, 650, 602, 554, 506, 458, 410, 362, 314, 266, 218, 170, 122, 74, 26}; int[] permaLocations = {26, 74, 122, 170, 218, 266, 314, 362, 410, 458, 506, 554, 602, 650, 698, 746, 794, 842}; int[] redValue = {31, 0, 150, 0, 128, 0, 0, 128, 255, 204, 255, 128, 255, 247, 160, 255, 210, 255}; int[] greenValue = {117, 255, 75, 173, 128, 255, 0, 128, 88, 204, 191, 0, 0, 127, 32, 0, 180, 255}; int[] blueValue = {254, 255, 0, 67, 128, 0, 128, 0, 0, 255, 0, 0, 255, 190, 240, 0, 140, 0}; float[] changingScores = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int[] newScores = {1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 20, 25, 30, 40, 50, 60, 75, 100}; float[] changingExtensions = {5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5}; float[] newExtensions = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; String[] names = {"Blue", "Cyan", "Brown", "Green", "Grey", "Lime", "Navy", "Olive", "Orange", "Lavender", "Gold", "Maroon", "Magenta", "Pink", "Purple", "Red", "Tan", "Yellow"}; String placeHolder; float[] locationIncrements = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; float[] scoreIncrements = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; float[] extensionsIncrements = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int redIncrease = 0; int numberOfPlayers = 18; boolean extension = true; boolean movement = true; boolean elimination = true; boolean beginExtension = false; boolean beginMovement = false; boolean beginElimination = false; void setup() { size(1600, 900); frameRate(60); background(0); for(int i = 0; i < numberOfPlayers; i++){ locationIncrements[i] = (float(newLocations[i]) - changingLocations[i]) / 300; scoreIncrements[i] = (float(newScores[i]) - changingScores[i]) / 300; newExtensions[i] = (1050.0 / 100.0) * float(newScores[i]); extensionsIncrements[i] = newExtensions[i] / 300; } } void draw() { background(0); fill(75); noStroke(); rect(-1, -1, 251, 1601); fill(255); textSize(32); textAlign(RIGHT, BOTTOM); for(int i = 0; i < numberOfPlayers; i++){ switch(i){ case 0: placeHolder = "st"; break; case 1: placeHolder = "nd"; break; case 2: placeHolder = "rd"; break; default: placeHolder = "th"; } text((i + 1) + placeHolder, 80, permaLocations[i] + 34); } for(int i = 0; i < numberOfPlayers; i++){ fill(255); textAlign(LEFT, BOTTOM); text(int(changingScores[i]), 260 + changingExtensions[i], changingLocations[i] + 34); textAlign(RIGHT, BOTTOM); fill(redValue[i], greenValue[i], blueValue[i]); rect(250, changingLocations[i], changingExtensions[i], 32); text(names[i], 235, changingLocations[i] + 33); } if(beginExtension == true){ for(int i = 0; i < numberOfPlayers; i++){ if(changingScores[i] + scoreIncrements[i] < newScores[i]){ changingScores[i] = changingScores[i] + scoreIncrements[i]; }else{ changingScores[i] = newScores[i]; } if(changingExtensions[i] + extensionsIncrements[i] < newExtensions[i]){ changingExtensions[i] = changingExtensions[i] + extensionsIncrements[i]; }else{ changingExtensions[i] = newExtensions[i]; } } } if(beginMovement == true){ for(int i = 0; i < numberOfPlayers; i++){ if(locationIncrements[i] > 0){ if(changingLocations[i] + locationIncrements[i] < newLocations[i] + 1){ changingLocations[i] = changingLocations[i] + locationIncrements[i]; } } if(locationIncrements[i] < 0){ if(changingLocations[i] + locationIncrements[i] > newLocations[i] + 1){ changingLocations[i] = changingLocations[i] + locationIncrements[i]; } } } } if(beginElimination == true){ fill(redIncrease, 0, 0); textAlign(LEFT, BOTTOM); text("ELIMINATED", 300, 842 + 34); if(redIncrease < 256){ redIncrease += 1; } } } void keyPressed() { if(key == '1' && extension == true){ beginExtension = true; extension = false; }else if(key == '2' && movement == true){ beginMovement = true; movement = false; }else if(key == '3' && elimination == true){ beginElimination = true; elimination = false; } }