Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stage {
- backdrop EndGame("gallery:General/Black")
- backdrop Game("gallery:Nature/Sky Day")
- let N = 12;
- let point = 0;
- let game = false;
- function touchCheck(item) {
- if(item.costumeId % 2 == 1) {
- item.nextCostume();
- this.point += item.costumeId;
- }
- else {
- this.point += 3 * item.costumeId;
- item.deleteClone();
- }
- }
- function createBricks() {
- for(let i = 1; i <= 3; i++) {
- this.Brick.setCostume(2 * i - 1);
- this.Brick.setPosition(-280, -10 + i * 50);
- for(let j = 1; j <= this.N; j++) {
- this.createClone(this.Brick);
- this.Brick.x += 50;
- }
- }
- }
- when started {
- this.point = 0;
- this.setScene(this.Game);
- this.showVariable(ref this.point);
- this.Digit.countdown();
- this.createBricks();
- this.Ball.starting();
- }
- actor Slider {
- costume Blue("gallery:Objects/Slider Blue")
- when stage.started {
- this.size = 130;
- this.show();
- this.setPosition(0, -155);
- }
- when stage.started {
- while(true) {
- if(isKeyPressed("left arrow") && !this.touching(Edge.left)) {
- this.x -= 11;
- }
- if(isKeyPressed("right arrow") && !this.touching(Edge.right)) {
- this.x += 11;
- }
- this.wait(0.01);
- }
- }
- }
- actor StageBottom {
- costume Alap("gallery:Objects/Line Idle")
- when stage.started {
- this.show();
- this.setPosition(0, -176);
- }
- }
- actor Brick {
- costume Blue("gallery:Objects/Square Blue")
- costume DarkBlue("gallery:Objects/Square Dark Blue")
- costume Grey("gallery:Objects/Square Grey")
- costume Brown("gallery:Objects/Square Brown")
- costume LightGreen("gallery:Objects/Square Light Green")
- costume Green("gallery:Objects/Square Green")
- when stage.started {
- this.hide();
- this.size = 150;
- game = true;
- }
- when cloned {
- this.show();
- while(game) {
- if(this.touching(Ball)) {
- touchCheck(this);
- Ball.turnRight(180);
- this.wait(0.1);
- }
- }
- this.deleteClone();
- }
- }
- actor Ball {
- costume Red("gallery:Objects/Ball Red")
- function starting() {
- this.heading = Math.randomBetween(-60, 60);
- while(!this.touching(StageBottom) && Brick.cloneCount > 0) {
- if(this.touching(Slider)) {
- this.pointTowards(Slider);
- this.turnRight(180);
- }
- this.move(13);
- this.wait(0.05);
- this.bounceOffEdge();
- }
- setScene(EndGame);
- game = false;
- EndText.gameOver();
- this.hide();
- }
- when stage.started {
- this.size = 60;
- this.rotationStyle = "leftRight";
- this.show();
- this.setPosition(0, -100);
- this.goToFront();
- this.size = 70;
- }
- }
- actor Digit {
- costume Three("gallery:Text/Three")
- costume Two("gallery:Text/Two")
- costume One("gallery:Text/One")
- function countdown() {
- this.show();
- for(let i = 1; i <= 3; i++) {
- this.setCostume(i);
- this.wait(1);
- }
- this.hide();
- }
- when stage.started {
- this.hide();
- this.setPosition(0, -50);
- }
- }
- actor EndText {
- costume Winner("gallery:Text/Winner Green")
- costume GameOver("gallery:Text/Game Over 1")
- function gameOver() {
- if(Brick.cloneCount == 0) {
- this.setCostume(this.Winner);
- }
- else {
- this.setCostume(this.GameOver);
- }
- Slider.hide();
- this.show();
- }
- when stage.started {
- this.hide();
- }
- }
- actor Érme {
- costume Arany("gallery:Objects/Coin Gold Writing")
- costume Ezüst("gallery:Objects/Coin Silver Writing")
- function newCoin(X, Y) {
- this.setPosition(X, Y);
- createClone(this);
- }
- when stage.started {
- this.hide();
- this.size = 70;
- }
- when cloned {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement