float theta; int i; int q; int p; PFont myfont; String j = "現実"; PFont myfont2; String l = "クリックして現実から逃げよう"; PFont myfont3; String h = "つらい……"; PImage P; void setup() { size(500, 500); fill(162, 132, 118); noStroke(); theta=0; frameRate(300); myfont = createFont("明朝", 50); textFont(myfont); myfont2 = createFont("MS Gothic", 30); textFont(myfont2); myfont3 = createFont("明朝", 30); textFont(myfont3); i=10; P=loadImage("./sora.png"); } void draw() { frameRate(300); background(150); translate(-50,0); fill(100); pushMatrix(); translate(0, -100); rect(490, 180, 80, 400);//ビル群 後 ellipse(440, 180, 70, 70); strokeWeight(5); stroke(100); line(440, 130, 440, 180); noStroke(); rect(220, 200, 80, 400); ellipse(260, 200, 80, 60); rect(400, 180, 80, 400); rect(345, 260, 150, 400); rect(290, 260, 150, 400); rect(0, 280, 200, 400); rect(60, 240, 50, 400); rect(350, 280, 100, 400); rect(118, 240, 50, 400); popMatrix(); fill(50); rect(200, 180, 80, 200);//ビル群  rect(118, 220, 80, 200); rect(400, 180, 80, 200); rect(345, 260, 50, 200); rect(290, 260, 50, 200); rect(0, 280, 50, 200); rect(60, 240, 50, 200); rect(550, 280, 50, 200); rect(490, 240, 50, 200); fill(60); ellipse(300, 580, 1000, 500);//地面 fill(255); rect(210, 200, 10, 10);//窓 rect(230, 200, 10, 10); rect(250, 200, 10, 10); rect(210, 220, 10, 10); rect(230, 220, 10, 10); rect(250, 220, 10, 10); rect(210, 240, 10, 10); pushMatrix(); translate(0, 40); rect(130, 200, 5, 5);//窓(小1) rect(140, 200, 5, 5); rect(150, 200, 5, 5); rect(160, 200, 5, 5); rect(170, 200, 5, 5); rect(180, 200, 5, 5); rect(130, 220, 5, 5); rect(140, 220, 5, 5); rect(150, 220, 5, 5); rect(160, 220, 5, 5); rect(170, 220, 5, 5); rect(180, 220, 5, 5); rect(130, 240, 5, 5); rect(140, 240, 5, 5); rect(150, 240, 5, 5); rect(160, 240, 5, 5); rect(170, 240, 5, 5); rect(180, 240, 5, 5); popMatrix(); pushMatrix(); translate(280, 0); rect(130, 200, 5, 5);//窓 rect(140, 200, 5, 5); rect(150, 200, 5, 5); rect(160, 200, 5, 5); rect(170, 200, 5, 5); rect(180, 200, 5, 5); rect(130, 220, 5, 5); rect(140, 220, 5, 5); rect(150, 220, 5, 5); rect(160, 220, 5, 5); rect(170, 220, 5, 5); rect(180, 220, 5, 5); rect(130, 240, 5, 5); rect(140, 240, 5, 5); rect(150, 240, 5, 5); rect(160, 240, 5, 5); rect(170, 240, 5, 5); rect(180, 240, 5, 5); popMatrix(); translate(50,0); fill(255); ellipse(100, 40, 200, 80); ellipse(140, 80, 35, 30); ellipse(160, 100, 15, 15); fill(100); textSize(15); textAlign(CENTER); text(h, 100, 50); translate(-50,0); fill(255); textSize(50); textAlign(CENTER); text(j, 300, 420); textSize(20); textAlign(CENTER); text(l, 300, 460); if (mousePressed) { image(P, -50, -50, 700, 600); } pushMatrix();//おっきくまとめ(buranko) translate(25, 0); fill(0); if (mousePressed) { fill(162, 132, 118); } arm(300, 0, 12);//rope //ellipse(0, -80, 40, 40); rotate(-sin(theta*PI/180)); rect(-45, 5, 90, 10);//ita pushMatrix(); rotate(0.3*sin(theta*PI/180)); rect(0, -130, 10, 30); ellipse(0, -60, 50, 100); ellipse(0, -140, 50, 50); rect(-50, -20, 65, 30);//doutai ellipse(-50, -20+15, 30, 30); translate(-50, -5); rotate(-1.2*sin(theta*PI/180+PI/2)+0.5); ellipse(0, 0, 30, 30); rect(-15, 0, 30, 80); rect(-25, 70, 40, 20);//ashi popMatrix(); pushMatrix(); rotate(0.3*sin(theta*PI/180)); arm2(0, -130, 6); triangle(35, 15, 8, 0, 35, -15);//kami popMatrix(); pushMatrix(); rotate(0.3*sin(theta*PI/180)); // ellipse(-30, -100, 30, 30); popMatrix(); theta--; pushMatrix(); rotate(sin(theta*PI/180)); arm3(0, -180, 0); translate(5, -100); pushMatrix(); rotate(sin(theta*PI/180)); ellipse(0, 20, 30, 30);//hand //ellipse(-10, -10, 20, 20); popMatrix(); //rect(-10, 20, 15, 40);//ude popMatrix(); popMatrix(); if (mousePressed) { frameRate(30); fill(255, 100); rect(0, 0, 600, 500); if (frameCount / 10% 3 == 0) {//キラキラ fill(#FCF5A6, 20); } else { fill(255, 60); } ellipse(width/4, height/5, i, i); //ellipse(width/4, height/5, 200*sin(2*i*PI/180), 200*sin(2*i*PI/180)); if (i < 200) { i = i+4; } if (i >= 200) { i = 4; } ellipse(400, 400, i, i); if (i < 300) { i = i+1; } if (i >= 300) { i = 1; } ellipse(300, 350, q, q); if (q < 300) { q = q+3; } if (q >= 300) { q = 1; } ellipse(500, 50, q, q); if (q < 300) { q = q+3; } if (q >= 300) { q = 1; } ellipse(400, 150, p, p); if (p < 350) { p = p+4; } if (p >= 350) { p = 4; } ellipse(80, 350, p, p); if (p < 350) { p = p+4; } if (p >= 350) { p = 4; } } } void arm(float x, float y, int depth) { if (depth==0) return; translate(x, y); float rot=0.15*sin(theta*PI/180); rotate(rot); ellipse(5, 0, 5, 30); depth--; arm(0, 30, depth); } void arm2(float x, float y, int depth) { if (depth==0) return; translate(x, y); float rot=0.3*sin(-theta*PI/180); rotate(rot); ellipse(0, 0, 15, 10); scale(0.9); depth--; arm2(15, 0, depth); } void arm3(float x, float y, int depth) { if (depth==0) return; translate(x, y); float rot=sin(theta*PI/180); rotate(rot); //ellipse(0, 0, 15, 10); //scale(0.9); depth--; arm3(0, 0, depth); }