Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. stage {
  2. backdrop White("gallery:General/White")
  3.  
  4. let score = 0;
  5. let game = true;
  6. let v = 0;
  7.  
  8. function gameOver() {
  9. this.game = false;
  10. this.Rozmár.hide();
  11. this.Tégla.getClone(1).hide();
  12. this.Tégla.getClone(2).hide();
  13. this.Game_Over.show();
  14. }
  15.  
  16. when started {
  17. this.game = true;
  18. this.score = 0;
  19. }
  20.  
  21. actor Rozmár {
  22. costume Alap("gallery:Animals/Walrus Idle")
  23. costume Mozog("gallery:Animals/Walrus Move")
  24.  
  25. when stage.started {
  26. while (game) {
  27. v--;
  28. this.y += v;
  29. this.wait(0.05);
  30. }
  31. }
  32.  
  33. when stage.keyPressed("space"){
  34. v = 10;
  35. for (let i = 1; i <= 5; i++) {
  36. this.nextCostume();
  37. this.wait(0.1);
  38. }
  39. }
  40.  
  41. when stage.started {
  42. this.show();
  43. v = 5;
  44. this.setPosition(-90, 0);
  45. this.heading = 90;
  46. this.size = 50;
  47. while (game) {
  48. if (this.touching(Edge.any)) {
  49. gameOver();
  50. }
  51. }
  52. }
  53. }
  54.  
  55. actor Tégla {
  56. costume Tégla_1("gallery:Objects/Brick 1")
  57.  
  58. when stage.started {
  59. this.hide();
  60. this.heading = 0;
  61. createClone(this);
  62. createClone(this);
  63. }
  64. when cloned {
  65. this.setPosition(300, Math.pow(-1, cloneId) * Math.randomBetween(150, 200));
  66. this.show();
  67. while(game) {
  68. this.glideSecondsTo(4, -300, this.y);
  69. if(this.cloneId == 1 && game) {
  70. score += 1;
  71. Karika.sayScore();
  72. }
  73. this.setPosition(300, Math.pow(-1, cloneId) * Math.randomBetween(150, 200));
  74. }
  75. }
  76. when cloned {
  77. while(game) {
  78. if(this.touching(Rozmár)) {
  79. gameOver();
  80. }
  81. }
  82. }
  83. }
  84.  
  85. actor Game_Over {
  86. costume Game_Over_1("gallery:Text/Game Over 1")
  87.  
  88. when stage.started {
  89. this.hide();
  90. }
  91. }
  92.  
  93. actor Karika {
  94. costume Piros("gallery:Objects/Ring Red")
  95.  
  96. function sayScore() {
  97. this.think(score);
  98. }
  99.  
  100. when stage.started {
  101. this.hide();
  102. this.setPosition(-300, 150);
  103. }
  104. }
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement