xxxxxxxxxx
115
let countries = ['North Korea', 'Canada', 'New Zealand', 'Uzbekistan', 'Azerbaijan', 'Russia', 'USA', 'China', 'Chuck Norris'];
let string1;
let string2
function setup() {
background(255);
string1 = int(random(8));
string2 = int(random(8));
createCanvas(1000, 1000);
if (countries[string1] == 'Chuck Norris') {
for (let i = 0; i < 200; i++) {
nuke1(random(width), random(700, height - 150));
stickfigure1(random(width), random(560, height - 150), 8);
}
}
if (countries[string2] == 'Chuck Norris') {
for (let i = 0; i < 200; i++) {
nuke2(random(width), random(150, 300));
stickfigure1(random(width), random(300, 400), 8);
}
}
}
function draw() {
strokeWeight(1);
textSize(75);
text('River', 400, 525);
strokeWeight(2);
rect(-1, 450, (width + 2), 100);
launcher1(10, 949);
launcher1(890, 949);
bunker1(300, 901);
nuke1(150, 900);
nuke1(450, 750);
nuke1(750, 900);
launcher2(10, 51);
launcher2(890, 51);
bunker2(300, 99)
nuke2(150, 100);
nuke2(450, 250);
nuke2(750, 100);
if (frameCount > 200 && countries[string1] == 'Chuck Norris' && countries[string2] == 'Chuck Norris') {
background(0);
}
}
function launcher1(x, y) {
stroke(0);
strokeWeight(2);
noFill();
rect(x, y, 100, 50);
rect((x + 25), (y - 75), 50, 75);
}
function bunker1(x, y) {
stroke(0);
noFill();
rect(x, y, 400, 100);
rect((x + 50), (y + 50), 300, 50);
rect((x + 125), (y + 75), 150, 30);
textSize(35);
strokeWeight(1)
text(countries[string1], (x + 10), (y + 35));
stickfigure1((x + 200), (y + 82), 8);
}
function nuke1(x, y) {
launcher1(x, y);
triangle((x + 30), (y - 75), (x + 70), (y - 75), (x + 50), (y - 150));
}
function stickfigure1(x, y, size) {
strokeWeight(1);
noFill();
ellipse(x, y, size);
line(x, y + (size / 2), x, y + (size / 2) + size);
line(x, y + (size / 2) + size, x - (size / 2), y + (size * 2));
line(x, y + (size / 2) + size, x + (size / 2), y + (size * 2));
line(x, y + (size / 2), x - (size / 2), y + size);
line(x, y + (size / 2), x + (size / 2), y + size);
line((x - (size / 6)), (y - (size / 6)), (x - (size / 6)), (y + (size / 8)));
line((x + (size / 6)), (y - (size / 6)), (x + (size / 6)), (y + (size / 8)));
line((x - (size / 8)), (y + (size / 4)), (x + (size / 8)), (y + (size / 4)));
}
function launcher2(x, y) {
stroke(0);
strokeWeight(2);
noFill();
rect(x, (y - 50), 100, 50);
rect((x + 25), y, 50, 75);
}
function bunker2(x, y) {
stroke(0);
noFill();
rect(x, (y - 101), 400, 100);
rect((x + 50), (y - 100), 300, 50);
rect((x + 125), (y - 100), 150, 30);
textSize(35);
strokeWeight(1);
angleMode(DEGREES);
push();
translate((x + 390), (y - 35));
rotate(180);
text(countries[string2], 0, 0);
stickfigure1(x - 110, y - 54, 8);
pop();
}
function nuke2(x, y) {
angleMode(DEGREES);
launcher2(x, y);
triangle((x + 30), (y + 75), (x + 70), (y + 75), (x + 50), (y + 150));
}