Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. import lib/clocks;
  2. ## Clock for animation
  3. setedenclock(&tick, 30);
  4.  
  5. ## Jupiter
  6. jupiterX = 230;
  7. jupiterY = 230;
  8. jupiterCenterX = jupiterX + 30;
  9. jupiterCenterY = jupiterY + 30;
  10.  
  11. jupiterImage = "https://d2xkkdgjnsfvb0.cloudfront.net/pub/n/images/planets/jupiter.gif";
  12. jupiter is Image(jupiterX, jupiterY, 60, 60, jupiterImage);
  13. ##jupiter is Circle(jupiterX, jupiterY, 30, "brown");
  14.  
  15. ## Galilean moons, Io, Europa, Ganymede, Callisto
  16. ioDistance = 65;
  17. ioX is jupiterCenterX + sin(tick/1.769) * ioDistance;
  18. ioY is jupiterCenterY + cos(tick/1.769) * ioDistance;
  19. ioImage = "https://openclipart.org/image/2400px/svg_to_png/227574/Io.png";
  20. io is Image(ioX-15, ioY-15, 30, 30, ioImage);
  21. ## io is Circle(ioX, ioY, 10, "gold");
  22.  
  23. europaDistance = 95;
  24. europaX is jupiterCenterX + sin(tick/3.551) * europaDistance;
  25. europaY is jupiterCenterY + cos(tick/3.551) * europaDistance;
  26. europaImage = "https://openclipart.org/image/2400px/svg_to_png/227577/Europa.png";
  27. europa is Image(europaX-13, europaY-13, 26, 26, europaImage);
  28. ## europa is Circle(europaX, europaY, 10, "blue");
  29.  
  30. ganymedeDistance = 150;
  31. ganymedeX is jupiterCenterX + sin(tick/7.155) * ganymedeDistance;
  32. ganymedeY is jupiterCenterY + cos(tick/7.155) * ganymedeDistance;
  33. ganymedeImage = "http://www.solarsystemscope.com/nexus/content/moon_images/render_ganymede.png";
  34. ganymede is Image(ganymedeX-23, ganymedeY-23, 47, 47, ganymedeImage);
  35. ## ganymede is Circle(ganymedeX, ganymedeY, 10, "brown");
  36.  
  37. callistoDistance = 220;
  38. callistoX is jupiterCenterX + sin(tick/16.689) * callistoDistance;
  39. callistoY is jupiterCenterY + cos(tick/16.689) * callistoDistance;
  40. callistoImage = "http://www.solarsystemscope.com/nexus/content/moon_images/render_callisto.png";
  41. callisto is Image(callistoX-21, callistoY-21, 43, 43, callistoImage);
  42. ## callisto is Circle(callistoX, callistoY, 10, "green");
  43.  
  44. pauseButton is Button("Pause", 10, 10, true);
  45. continueButton is Button("Continue", 70, 10, true);
  46. alignButton is Button("Align", 150, 10, true);
  47.  
  48. when (pauseButton_click) {
  49. edenclocks_paused = true;
  50. }
  51.  
  52. when (continueButton_click) {
  53. edenclocks_paused = false;
  54. }
  55.  
  56. when (alignButton_click) {
  57. tick = 0;
  58. }
  59.  
  60.  
  61. backgroundImage = "http://www.gunnars.com/wp-content/uploads/2014/08/Space.jpg";
  62. background is Image(0,0, 650, 650, backgroundImage);
  63. picture is[background, jupiter, io, europa, ganymede, callisto, pauseButton, continueButton, alignButton];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement