Advertisement
Guest User

Untitled

a guest
Jan 19th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. setScreen("startingScreen");
  2.  
  3. function moon(R,G,B) {
  4. penUp();
  5. moveTo(320,450);
  6. penDown();
  7. penRGB(R,G,B,1);
  8. dot(155);
  9. }
  10.  
  11. function realisticStar(R,G,B){
  12. penRGB(R,G,B,1);
  13. turnRight(20);
  14. penUp();
  15. moveForward();
  16. penDown();
  17. for (var i = 0; i < 4; i++) {
  18. turnRight(145);
  19. moveForward(9);
  20. }
  21. }
  22.  
  23. function shading(R,G,B) {
  24. penUp();
  25. moveTo(160,450);
  26. penDown();
  27. penWidth(10);
  28. penRGB(R,G,B,0.3);
  29. arcRight(90,158);
  30. }
  31.  
  32. function craters(R,G,B) {
  33. penUp();
  34. moveTo(288,411);
  35. penDown();
  36. penRGB(R,G,B,0.9);
  37. for (var i = 0; i < 10; i++) {
  38. penUp();
  39. moveTo(randomNumber(230,450), randomNumber(450,350));
  40. penDown();
  41. dot(randomNumber(1,6));
  42. }}
  43.  
  44. function dotStars(R,G,B) {
  45. for (var i = 0; i < 550; i++) {
  46. penUp();
  47. moveTo(randomNumber(0,2000), randomNumber(500,0));
  48. penDown();
  49. penRGB(R,G,B,1);
  50. dot(1);
  51. }}
  52.  
  53. onEvent("button1", "click", function() {
  54. setScreen("originalSlide");
  55. });
  56.  
  57. onEvent("button2", "click", function() {
  58. setScreen("startingScreen");
  59. turnTo(0);
  60. });
  61.  
  62. onEvent("button3", "click", function() {
  63. setScreen("interactive");
  64. });
  65.  
  66. function storedata(){
  67. onEvent("moonDropDown", "change", function() {
  68. var moonColor = getText("moonDropDown");
  69. if (moonColor == "Red") {
  70. moon(255, 0, 0, 1);
  71. } else {
  72. if (moonColor == "Green") {
  73. moon(0, 255, 0, 1);
  74. } else {
  75. moon(0, 0, 255, 1);
  76. }}
  77. });
  78. onEvent("dropdown2", "change", function() {
  79. var moonCraters = getText("dropdown2");
  80. if (moonCraters == "Red") {
  81. craters(255, 0, 0, 1);
  82. } else {
  83. if (moonCraters == "Green") {
  84. craters(0, 255, 0, 1);
  85. } else {
  86. craters(0, 0, 255, 1);
  87. }}
  88. });
  89. onEvent("dropdown3", "change", function() {
  90. var moonShading = getText("dropdown3");
  91. if (moonShading == "Red") {
  92. shading(255, 0, 0, 1);
  93. } else {
  94. if (moonShading == "Green") {
  95. shading(0, 255, 0, 1);
  96. } else {
  97. shading(0, 0, 255, 1);
  98. }}
  99. });
  100. onEvent("dropdown4", "change", function() {
  101. var realStars = getText("dropdown4");
  102. if (realStars == "Red") {
  103. realisticStar(255, 0, 0, 1);
  104. } else {
  105. if (realStars == "Green") {
  106. realisticStar(0, 255, 0, 1);
  107. } else {
  108. realisticStar(0, 0, 255, 1);
  109. }}
  110. });
  111. onEvent("dropdown5", "change", function() {
  112. var litty = getText("dropdown5");
  113. if (litty == "Red") {
  114. dotStars(255, 0, 0, 1);
  115. } else {
  116. if (litty == "Green") {
  117. dotStars(0, 255, 0, 1);
  118. } else {
  119. dotStars(0, 0, 255, 1);
  120. }}
  121. });
  122. }
  123. onEvent("button4", "click", function() {
  124. setScreen("interactiveOutput");
  125. storedata();
  126. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement