Advertisement
Guest User

Untitled

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