Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int r = 50;
- boolean donut = false;
- float x, x1, x2, y1, y2;
- float y = -60;
- void setup(){
- size(500,500);
- }
- void draw(){
- background(255, 255, 0);
- fill(255);
- ellipse((width/2)-50, (height/2), r, r);
- ellipse((width/2)+50, (height/2), r, r);
- if(donut==false){
- x1 = map(mouseX, 0, width, -15, 15);
- y1= map(mouseY, 0, height, -15, 15);
- fill(0);
- ellipse(((width/2)-50)+x1, (height/2)+y1, 10, 10);
- x2 = map(mouseX, 0, width, -15, 15);
- y2 = map(mouseY, 0, height, -15, 15);
- ellipse(((width/2)+50)+x2, (height/2)+y2, 10, 10);
- }else{
- x1 = map(x, 0, width, -15, 15);
- y1= map(y, 0, height, -15, 15);
- fill(0);
- ellipse(((width/2)-50)+x1, (height/2)+y1, 10, 10);
- x2 = map(x, 0, width, -15, 15);
- y2 = map(y, 0, height, -15, 15);
- ellipse(((width/2)+50)+x2, (height/2)+y2, 10, 10);
- }
- }
- void mousePressed(){
- }
Advertisement
Add Comment
Please, Sign In to add comment