嗨
🔹今天找到了新的槌子,我覺得他比較好看我要換他
🔸是不是比較可愛
PImage img,hammer1,hammer2;
void setup()
{
size(320,400);//設定背景大小
img = loadImage("ground.jpg");//匯入圖片
imageMode(CENTER);
hammer1=loadImage("hammer.png");//槌子
hammer2=loadImage("hammer2.png");
noCursor();
}
void draw(){
background(255);//背景顏色
image(img,160,278);
if(mousePressed)image(hammer2,mouseX,mouseY,250,200);//點擊滑鼠就更換到槌下去的圖片
else image(hammer1,mouseX,mouseY,190,170);
}
沒有留言:
張貼留言