//葉っぱの数 int n=1000; //リンゴの数 int m=5; //カウンター int count=0; int rcount=0; int goal=30; //かごの表示 float px=250, py=400; //葉っぱの座標 float[] x1=new float[n]; float[] y1=new float[n]; //リンゴの座標 float[] x2=new float[m]; float[] y2=new float[m]; float[] x3=new float[m]; //リンゴの落下速度 float[] v=new float[m]; //重力加速度 float g=0.3; //場面転換 int start; void setup() { size(500, 500); background(255, 243, 131); //葉っぱの初期設定(ランダムに生成) for (int i=0; ix2[i]+15&&py-6y2[i]) { rcount+=1; } } if (rcount==goal) { start=4; } } if (start==4) { background(0); fill(255); textSize(20); textAlign(CENTER); text("FINISH!", width/2, height/3); text("-press q key-", width/2, height/2); if (keyPressed==true) { if (key=='q') { start=0; rcount=0; } } } }