產生基本畫面 上下左右時間
PImage[] arrow=new PImage[8];
int a[]= {
132131, 132010, 323102, 210320, 231012, 103202, 210231, 323120, 213013, 132012
};
int time, Long, num;
PImage endImg;
void setup() {
size(800, 800);
arrow[0]=loadImage("up.png");
arrow[1]=loadImage("right.png");
arrow[2]=loadImage("down.png");
arrow[3]=loadImage("left.png");
arrow[4]=loadImage("up2.png");
arrow[5]=loadImage("right2.png");
arrow[6]=loadImage("down2.png");
arrow[7]=loadImage("left2.png");
endImg=loadImage("circle.png");
Long=(int)random(3)+3;
num=(int)random(9);
}
void draw() {
background(255, 204, 0);
noStroke();
fill(#AA0C0C);
rect(100, 525,600,20, 7);
noStroke();
fill(#FFE603);
rect(700, 530,-(600-time*2),10, 7);
image(endImg,650, 500,80,80);
time++;
if (time==300) {
Long=(int)random(3)+3;
num=(int)random(10);
println(num);
time=0;
}
else {
int A=a[num];
for (int i=0;i<Long;i++) {
image(arrow[A%10], (i+1)*100, 500,80,80);
println(num);
A/=10;
}
}
/*image(upImg, 0, 0);
image(rightImg, 100, 100);
image(leftImg, 200, 200);
image(downImg, 300, 300);*/
}

沒有留言:
張貼留言