Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 KB | None | 0 0
  1. stage
  2. {
  3. scene Sky("gallery:Nature/Sky Day");
  4.  
  5. let score = 0;
  6. let game = false;
  7. let v = 0;
  8.  
  9. when stage.started
  10. {
  11. game = true;
  12. score = 0;
  13. }
  14.  
  15. function gameOver()
  16. {
  17. game = false;
  18. Walrus.hide();
  19. Brick.getClone(1).hide();
  20. Brick.getClone(2).hide();
  21. GameOver.show();
  22. }
  23.  
  24. actor Walrus
  25. {
  26. costume Idle("gallery:Animals/Walrus Idle");
  27. costume Move("gallery:Animals/Walrus Move");
  28.  
  29. when stage.started
  30. {
  31. while(Game)
  32. {
  33. v--;
  34. this.position.y += v;
  35. this.wait(0.05);
  36. }
  37. }
  38.  
  39. when stage.keyPressed("space")
  40. {
  41. v = 10;
  42. for(let i = 0;i < 5; i++)
  43. {
  44. this.nextCostume();
  45. this.wait(0.1);
  46. }
  47. }
  48.  
  49. when stage.started
  50. {
  51. this.show();
  52. v = 5;
  53. this.setPosition(-90,0);
  54. this.heading = 90;
  55. this.size = 50;
  56. while(game)
  57. {
  58. if(this.touching(stage.edge))
  59. {
  60. gameOver();
  61. }
  62. }
  63. }
  64. }
  65.  
  66. actor Brick
  67. {
  68. costume Brick_1("gallery:Objects/Brick 1");
  69.  
  70. when stage.started
  71. {
  72. this.hide();
  73. this.heading = 0;
  74. stage.createClone(this);
  75. stage.createClone(this);
  76. }
  77. when cloned
  78. {
  79. this.setPosition(300, Math.pow(-1, this.cloneId) * Math.randomBetween(150, 200));
  80. this.show();
  81. while(game)
  82. {
  83. this.glideSecondsTo(4,-300,this.y);
  84. if(this.cloneId == 1 && game)
  85. {
  86. score++;
  87. Circle.sayScore();
  88. }
  89. this.setPosition(300,Math.pow(-1,this.cloneId)* Math.randomBetween(150,200))
  90. }
  91. }
  92. when cloned
  93. {
  94. while(game)
  95. {
  96. if(this.touchingPrecisely("Walrus"))
  97. {
  98. gameOver();
  99. }
  100. }
  101. }
  102. }
  103.  
  104. actor gameOver
  105. {
  106. costume Game_Over_1("gallery:Characters/Game Over 1")
  107.  
  108. when stage.started
  109. {
  110. this.hide();
  111. }
  112. }
  113.  
  114. actor Circle
  115. {
  116. costume Red("gallery:Objects/Ring Red")
  117.  
  118. when stage.started
  119. {
  120. this.hide();
  121. this.setPosition(-300,150);
  122. }
  123.  
  124. function sayScore()
  125. {
  126. this.think(score);
  127. }
  128. }
  129.  
  130.  
  131. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement