Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- setScreen("startingScreen");
- function moon(R,G,B) {
- penUp();
- moveTo(320,450);
- penDown();
- penRGB(R,G,B,1);
- dot(155);
- }
- function realisticStar(R,G,B){
- penRGB(R,G,B,1);
- turnRight(20);
- penUp();
- moveForward();
- penDown();
- for (var i = 0; i < 4; i++) {
- turnRight(145);
- moveForward(9);
- }
- }
- function shading(R,G,B) {
- penUp();
- moveTo(160,450);
- penDown();
- penWidth(10);
- penRGB(R,G,B,0.3);
- arcRight(90,158);
- }
- function craters(R,G,B) {
- penUp();
- moveTo(288,411);
- penDown();
- penRGB(R,G,B,0.9);
- for (var i = 0; i < 10; i++) {
- penUp();
- moveTo(randomNumber(230,450), randomNumber(450,350));
- penDown();
- dot(randomNumber(1,6));
- }}
- function dotStars(R,G,B) {
- for (var i = 0; i < 550; i++) {
- penUp();
- moveTo(randomNumber(0,2000), randomNumber(500,0));
- penDown();
- penRGB(R,G,B,1);
- dot(1);
- }}
- onEvent("button1", "click", function() {
- setScreen("originalSlide");
- });
- onEvent("button2", "click", function() {
- setScreen("startingScreen");
- turnTo(0);
- });
- onEvent("button3", "click", function() {
- setScreen("interactive");
- });
- function storedata(){
- onEvent("moonDropDown", "change", function() {
- var moonColor = getText("moonDropDown");
- if (moonColor == "Red") {
- moon(255, 0, 0, 1);
- } else {
- if (moonColor == "Green") {
- moon(0, 255, 0, 1);
- } else {
- moon(0, 0, 255, 1);
- }}
- });
- onEvent("dropdown2", "change", function() {
- var moonCraters = getText("dropdown2");
- if (moonCraters == "Red") {
- craters(255, 0, 0, 1);
- } else {
- if (moonCraters == "Green") {
- craters(0, 255, 0, 1);
- } else {
- craters(0, 0, 255, 1);
- }}
- });
- onEvent("dropdown3", "change", function() {
- var moonShading = getText("dropdown3");
- if (moonShading == "Red") {
- shading(255, 0, 0, 1);
- } else {
- if (moonShading == "Green") {
- shading(0, 255, 0, 1);
- } else {
- shading(0, 0, 255, 1);
- }}
- });
- onEvent("dropdown4", "change", function() {
- var realStars = getText("dropdown4");
- if (realStars == "Red") {
- realisticStar(255, 0, 0, 1);
- } else {
- if (realStars == "Green") {
- realisticStar(0, 255, 0, 1);
- } else {
- realisticStar(0, 0, 255, 1);
- }}
- });
- onEvent("dropdown5", "change", function() {
- var litty = getText("dropdown5");
- if (litty == "Red") {
- dotStars(255, 0, 0, 1);
- } else {
- if (litty == "Green") {
- dotStars(0, 255, 0, 1);
- } else {
- dotStars(0, 0, 255, 1);
- }}
- });
- }
- onEvent("button4", "click", function() {
- setScreen("interactiveOutput");
- storedata();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement