Advertisement
Guest User

Untitled

a guest
Mar 28th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.79 KB | None | 0 0
  1. stage {
  2. backdrop EndGame("gallery:General/Black")
  3. backdrop Game("gallery:Nature/Sky Day")
  4. let N = 12;
  5. let point = 0;
  6. let game = false;
  7. function touchCheck(item) {
  8. if(item.costumeId % 2 == 1) {
  9. item.nextCostume();
  10. this.point += item.costumeId;
  11. }
  12. else {
  13. this.point += 3 * item.costumeId;
  14. item.deleteClone();
  15. }
  16. }
  17. function createBricks() {
  18. for(let i = 1; i <= 3; i++) {
  19. this.Brick.setCostume(2 * i - 1);
  20. this.Brick.setPosition(-280, -10 + i * 50);
  21. for(let j = 1; j <= this.N; j++) {
  22. this.createClone(this.Brick);
  23. this.Brick.x += 50;
  24. }
  25. }
  26. }
  27. when started {
  28. this.point = 0;
  29. this.setScene(this.Game);
  30. this.showVariable(ref this.point);
  31. this.Digit.countdown();
  32. this.createBricks();
  33. this.Ball.starting();
  34. }
  35.  
  36. actor Slider {
  37. costume Blue("gallery:Objects/Slider Blue")
  38. when stage.started {
  39. this.size = 130;
  40. this.show();
  41. this.setPosition(0, -155);
  42. }
  43. when stage.started {
  44. while(true) {
  45. if(isKeyPressed("left arrow") && !this.touching(Edge.left)) {
  46. this.x -= 11;
  47. }
  48. if(isKeyPressed("right arrow") && !this.touching(Edge.right)) {
  49. this.x += 11;
  50. }
  51. this.wait(0.01);
  52. }
  53. }
  54. }
  55.  
  56. actor StageBottom {
  57. costume Alap("gallery:Objects/Line Idle")
  58. when stage.started {
  59. this.show();
  60. this.setPosition(0, -176);
  61. }
  62. }
  63.  
  64. actor Brick {
  65. costume Blue("gallery:Objects/Square Blue")
  66. costume DarkBlue("gallery:Objects/Square Dark Blue")
  67. costume Grey("gallery:Objects/Square Grey")
  68. costume Brown("gallery:Objects/Square Brown")
  69. costume LightGreen("gallery:Objects/Square Light Green")
  70. costume Green("gallery:Objects/Square Green")
  71. when stage.started {
  72. this.hide();
  73. this.size = 150;
  74. game = true;
  75. }
  76. when cloned {
  77. this.show();
  78. while(game) {
  79. if(this.touching(Ball)) {
  80. touchCheck(this);
  81. Ball.turnRight(180);
  82. this.wait(0.1);
  83. }
  84. }
  85. this.deleteClone();
  86. }
  87. }
  88.  
  89. actor Ball {
  90. costume Red("gallery:Objects/Ball Red")
  91. function starting() {
  92. this.heading = Math.randomBetween(-60, 60);
  93. while(!this.touching(StageBottom) && Brick.cloneCount > 0) {
  94. if(this.touching(Slider)) {
  95. this.pointTowards(Slider);
  96. this.turnRight(180);
  97. }
  98. this.move(13);
  99. this.wait(0.05);
  100. this.bounceOffEdge();
  101. }
  102. setScene(EndGame);
  103. game = false;
  104. EndText.gameOver();
  105. this.hide();
  106. }
  107. when stage.started {
  108. this.size = 60;
  109. this.rotationStyle = "leftRight";
  110. this.show();
  111. this.setPosition(0, -100);
  112. this.goToFront();
  113. this.size = 70;
  114. }
  115. }
  116.  
  117. actor Digit {
  118. costume Three("gallery:Text/Three")
  119. costume Two("gallery:Text/Two")
  120. costume One("gallery:Text/One")
  121. function countdown() {
  122. this.show();
  123. for(let i = 1; i <= 3; i++) {
  124. this.setCostume(i);
  125. this.wait(1);
  126. }
  127. this.hide();
  128. }
  129. when stage.started {
  130. this.hide();
  131. this.setPosition(0, -50);
  132. }
  133. }
  134.  
  135. actor EndText {
  136. costume Winner("gallery:Text/Winner Green")
  137. costume GameOver("gallery:Text/Game Over 1")
  138. function gameOver() {
  139. if(Brick.cloneCount == 0) {
  140. this.setCostume(this.Winner);
  141. }
  142. else {
  143. this.setCostume(this.GameOver);
  144. }
  145. Slider.hide();
  146. this.show();
  147. }
  148. when stage.started {
  149. this.hide();
  150. }
  151. }
  152.  
  153. actor Érme {
  154. costume Arany("gallery:Objects/Coin Gold Writing")
  155. costume Ezüst("gallery:Objects/Coin Silver Writing")
  156.  
  157. function newCoin(X, Y) {
  158. this.setPosition(X, Y);
  159. createClone(this);
  160. }
  161.  
  162. when stage.started {
  163. this.hide();
  164. this.size = 70;
  165. }
  166.  
  167. when cloned {
  168.  
  169. }
  170. }
  171. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement