Guest User

Untitled

a guest
Jan 23rd, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. int ballPositionX = 250;
  2. int ballPositionY = 250;
  3. int ballSize = 20;
  4. int slowerSpeed = 50;
  5. int mouvement = 250;
  6. int linePt1 = 100;
  7. int linePt2 = 250;
  8. int linePt3 = 400;
  9. int rightLimit, leftLimit, bottomLimit, topLimit;
  10.  
  11. int moveX, moveY;
  12.  
  13. void setup(){
  14. size(500,500);
  15. }
  16.  
  17. void draw(){
  18. background(255);
  19. line(linePt1,linePt2,linePt3,linePt2);
  20. line(linePt2,linePt1,linePt2,linePt3);
  21. ellipse(ballPositionX, ballPositionY, ballSize, ballSize);
  22. moveX = (mouseX - 250);
  23. moveY = (mouseY - 250);
  24. ballPositionX = min(ballPositionX, moveX+ballPositionY);
  25. ballPositionY = max(ballPositionY, moveY+ballPositionX);
  26. }
Add Comment
Please, Sign In to add comment