下載圖片>右鍵>開啟檔案>用小畫家開啟
五顆子彈程式碼
PImage imgBG;int []x={0,0,0,0,0};
int []y={0,0,0,0,0};
int n=0;
void setup(){
size(1242,1553);
imgBG=loadImage("background.jpg");
}
void draw(){
background(imgBG);
for(int i=0;i<5;i++){
circle(x[i],y[i],40);
}
}
void mousePressed(){
if(n>=5) return;
x[n]=mouseX;
y[n]=mouseY;
n++;
}


沒有留言:
張貼留言