PImage img,hammer1,hammer2;
void setup()
{
size(500,500);
img = loadImage("ground.jpg");
imageMode(CENTER);
hammer1=loadImage("hammer.png");
hammer2=loadImage("hammer2.png");
noCursor();
}
void draw(){
background(255);
image(img,250,305);
if(mousePressed)image(hammer2,mouseX,mouseY,250,200);
else image(hammer1,mouseX,mouseY,190,170);
}
沒有留言:
張貼留言