Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int y;
- PImage star;
- PImage candy;
- float scale;
- void setup()
- {
- size(500,500);
- y = height/2;
- background(#000000);
- fill(#023F16);
- rect(0,y,width,y);
- star = loadImage("star.png");
- candy = loadImage("candy.png");
- scale = 1;
- }
- void draw()
- {
- //leave blank!!!!!!!!
- }
- void mouseClicked()
- {
- if(mouseY < y)
- {
- scale =.25* (y / mouseY);
- image(star,mouseX,mouseY,star.width*scale,star.height*scale);
- }
- else
- {
- scale =.25* (y / (height - mouseY));
- image(candy,mouseX,mouseY,candy.width*scale,candy.height*scale);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement