Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. var Present = createSprite(200, 270, 30, 30);
  2. Present.setAnimation("Present");
  3.  
  4. var surprise1 = createSprite(100, 200, 75, 75);
  5. surprise1.setAnimation("Parot");
  6.  
  7. surprise1.visible = false;
  8.  
  9. var surprise2 = createSprite(300, 200, 75, 75);
  10. surprise2.setAnimation("Present");
  11. surprise2.visible = false;
  12.  
  13. var shake_count = 0;
  14.  
  15. function draw() {
  16. background("lightblue");
  17. line(100, 100, 100, 400);
  18. line(300, 125, 300, 400);
  19. fill("yellow");
  20. fill("red");
  21. ellipse(100, 100, 75, 100);
  22. ellipse(300, 125, 75, 100);
  23.  
  24. if (mouseDidMove()) {
  25. present.rotation = randomNumber(-10, 10);
  26. shake_count = shake_count + 1;
  27. }
  28.  
  29. if (shake_count > 100){
  30. present.visible = false;
  31. surprise1.visible = true;
  32. surprise2.visible = true;
  33. playSound("274510__jbeetle__3-men-cheering.mp3");
  34. }
  35.  
  36. surprise1.rotation = surprise1.rotation + 1;
  37. surprise2.x = 275 + randomNumber(0,50);
  38. surprise2.y = 175 + randomNumber(0, 50);
  39. drawSprites();
  40.  
  41. fill('black');
  42. textSize(40);
  43. text("POLYYYY BAND!", 50, 40, 400, 100);
  44. textSize(20);
  45. text("Move the mouse to shake your present", 25, 360);
  46. text("Keep shaking to see your surprise!", 40, 380);
  47.  
  48. }
  49. var present = createSprite(200, 270, 30, 30);
  50. present.setAnimation("Present");
  51.  
  52. var surprise1 = createSprite(100, 200, 75, 75);
  53. surprise1.setAnimation("Parot");
  54.  
  55. surprise1.visible = false;
  56.  
  57. var surprise2 = createSprite(300, 200, 75, 75);
  58. surprise2.setAnimation("saxophone_1");
  59. surprise2.visible = false;
  60.  
  61. var shake_count = 0;
  62.  
  63. function draw() {
  64. background("lightblue");
  65. line(100, 100, 100, 400);
  66. line(300, 125, 300, 400);
  67. fill("yellow");
  68. fill("red");
  69. ellipse(100, 100, 75, 100);
  70. ellipse(300, 125, 75, 100);
  71.  
  72. if (mouseDidMove()) {
  73. present.rotation = randomNumber(-10, 10);
  74. shake_count = shake_count + 1;
  75. }
  76.  
  77. if (shake_count > 100){
  78. present.visible = false;
  79. surprise1.visible = true;
  80. surprise2.visible = true;
  81. playSound("274510__jbeetle__3-men-cheering.mp3");
  82. }
  83.  
  84. surprise1.rotation = surprise1.rotation + 1;
  85. surprise2.x = 275 + randomNumber(0,50);
  86. surprise2.y = 175 + randomNumber(0, 50);
  87. drawSprites();
  88. fill('black');
  89. textSize(40);
  90. text("POLYYYY BAND!", 50, 40, 400, 100);
  91. textSize(20);
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement