Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stage {
- backdrop White("gallery:General/White")
- let bouncing = false;
- let gameOn = true;
- actor Strand_Labda {
- costume Alap("gallery:Summer/Beach Ball Idle")
- when stage.started {
- this.physics.isCollides = true;
- this.physics.isStatic = false;
- this.physics.damping = 0.2;
- stage.physics.disableWall("top");
- this.physics.collisionShape = "polygon";
- this.physics.setVelocity(0, 0);
- this.setPosition(0, -150);
- stage.physics.horizontalGravity = 0;
- stage.physics.verticalGravity = 25;
- this.size = 30;
- this.show();
- }
- when stage.keyPressed("right arrow") {
- this.physics.applyForce(100, 90);
- }
- when stage.keyPressed("left arrow") {
- this.physics.applyForce(100, -90);
- }
- when stage.keyPressed("space") {
- if(!bouncing) {
- bouncing = true;
- this.physics.applyForce(400, 0);
- }
- }
- when touched {
- bouncing = false;
- }
- when stage.started {
- while(!this.touching(Edge.top)) {
- }
- gameOn = false;
- this.hide();
- }
- }
- actor Deszka {
- costume Vízszintes("gallery:Objects/Board Horizontal")
- when stage.started {
- this.setPosition(340, 0);
- this.heading = 90;
- this.size = 150;
- this.hide();
- this.setPosition(Math.randomBetween(-300, 300), 220);
- while(gameOn) {
- createClone(this);
- this.wait(3);
- if(this.x > 200) {
- this.x -= Math.randomBetween(120, 140);
- }else{
- if(this.x < -200) {
- if(this.x < -200) {
- this.x += Math.randomBetween(120,140);
- }
- }else{
- if (Math.randomBetween(0, 1) == 1) {
- this.x += Math.randomBetween(120, 170);
- }else{
- this.x -= Math.randomBetween(120, 170)
- }
- }
- }
- }
- this.deleteAllClones();
- }
- when cloned {
- this.show();
- this.physics.collisionShape = "polygon";
- while(this.y > -200) {
- this.y -= 0.35;
- wait(0.01);
- }
- this.deleteClone();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement