Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. stage {
  2. backdrop White("gallery:General/White")
  3. let bouncing = false;
  4. let gameOn = true;
  5.  
  6. actor Strand_Labda {
  7. costume Alap("gallery:Summer/Beach Ball Idle")
  8. when stage.started {
  9. this.physics.isCollides = true;
  10. this.physics.isStatic = false;
  11. this.physics.damping = 0.2;
  12. stage.physics.disableWall("top");
  13. this.physics.collisionShape = "polygon";
  14. this.setPosition(0, -150);
  15. stage.physics.horizontalGravity = 0;
  16. stage.physics.verticalGravity = 25;
  17. this.size = 30;
  18. this.show();
  19. }
  20. when stage.keyPressed("right arrow") {
  21. this.physics.applyForce(100, 90);
  22. }
  23. when stage.keyPressed("left arrow") {
  24. this.physics.applyForce(100, -90);
  25. }
  26. when stage.keyPressed("space") {
  27. if(!bouncing) {
  28. bouncing = true;
  29. this.physics.applyForce(400, 0);
  30. }
  31. }
  32. when touched {
  33. bouncing = false;
  34. }
  35. when stage.started {
  36. while(!this.touching(Edge.top)) {
  37.  
  38. }
  39. gameOn = false;
  40. this.hide();
  41. }
  42. }
  43.  
  44. actor Deszka {
  45. costume Vízszintes("gallery:Objects/Board Horizontal")
  46.  
  47. when stage.started {
  48. this.setPosition(340, 0);
  49. this.heading = 90;
  50. this.size = 150;
  51. this.hide();
  52. this.setPosition(Math.randomBetween(-300, 300), 220);
  53. while(gameOn) {
  54. createClone(this);
  55. this.wait(3);
  56. if(this.x > 200) {
  57. this.x -= Math.randomBetween(120, 140);
  58. }else{
  59. if(this.x < -200) {
  60. if(this.x < -200) {
  61. this.x += Math.randomBetween(120,140);
  62. }
  63. }else{
  64. if (Math.randomBetween(0, 1) == 1) {
  65. this.x += Math.randomBetween(120, 170);
  66. }else{
  67. this.x -= Math.randomBetween(120, 170)
  68. }
  69. }
  70. }
  71. }
  72. this.deleteAllClones();
  73. }
  74. when cloned {
  75. this.show();
  76. this.physics.collisionShape = "polygon";
  77. while(this.y > -200) {
  78. this.y -= 0.35;
  79. wait(0.01);
  80. }
  81. this.deleteClone();
  82. }
  83. }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement