Advertisement
Guest User

Untitled

a guest
Oct 17th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. function Rectangle(options) { //fini Exo1
  2. this.__proto__ = new Shape();
  3.  
  4. this.generatePoints = function (options) {
  5. var pointA = new Point();
  6. pointA.setToRandomPosition(10, 10);
  7. this.points.push(pointA);
  8. var pointB = new Point();
  9. pointB.x = pointA.x+options.maxWidth;
  10. pointB.y = pointA.y;
  11. this.points.push(pointB);
  12. var pointD = new Point();
  13. pointD.x = pointA.x+options.maxWidth;
  14. pointD.y = pointA.y+options.maxHeight;
  15. this.points.push(pointD);
  16. var pointC = new Point();
  17. pointC.x = pointA.x-options.maxWidth;
  18. pointC.y = pointA.y+options.maxHeight;
  19. this.points.push(pointC);
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement