Advertisement
Guest User

Snowman

a guest
Sep 16th, 2019
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. /* Constants representing the radius of the top, middle,
  2. * and bottom snowball. */
  3. var BOTTOM_RADIUS = 100;
  4. var MID_RADIUS = 60;
  5. var TOP_RADIUS = 30;
  6. function start(){
  7. var bottomY = getHeight() - BOTTOM_RADIUS;
  8. var midY = bottomY - BOTTOM_RADIUS - MID_RADIUS;
  9. var topY = midY - MID_RADIUS - TOP_RADIUS;
  10. var bottomCircle = new Circle(BOTTOM_RADIUS);
  11. bottomCircle.setPosition(getWidth()/2, bottomY);
  12. bottomCircle.setColor(Color.gray);
  13. add(bottomCircle);
  14. var middleCircle = new Circle(MID_RADIUS);
  15. middleCircle.setPosition(getWidth()/2, midY);
  16. middleCircle.setColor(Color.gray);
  17. add(middleCircle);
  18. var topCircle = new Circle(TOP_RADIUS);
  19. topCircle.setPosition(getWidth()/2, topY);
  20. topCircle.setColor(Color.gray);
  21. add(topCircle);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement