Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stage
- {
- scene Sky("gallery:Nature/Sky Day");
- let score = 0;
- let game = false;
- let v = 0;
- when stage.started
- {
- game = true;
- score = 0;
- }
- function gameOver()
- {
- game = false;
- Walrus.hide();
- Brick.getClone(1).hide();
- Brick.getClone(2).hide();
- GameOver.show();
- }
- actor Walrus
- {
- costume Idle("gallery:Animals/Walrus Idle");
- costume Move("gallery:Animals/Walrus Move");
- when stage.started
- {
- while(Game)
- {
- v--;
- this.position.y += v;
- this.wait(0.05);
- }
- }
- when stage.keyPressed("space")
- {
- v = 10;
- for(let i = 0;i < 5; i++)
- {
- this.nextCostume();
- this.wait(0.1);
- }
- }
- when stage.started
- {
- this.show();
- v = 5;
- this.setPosition(-90,0);
- this.heading = 90;
- this.size = 50;
- while(game)
- {
- if(this.touching(stage.edge))
- {
- gameOver();
- }
- }
- }
- }
- actor Brick
- {
- costume Brick_1("gallery:Objects/Brick 1");
- when stage.started
- {
- this.hide();
- this.heading = 0;
- stage.createClone(this);
- stage.createClone(this);
- }
- when cloned
- {
- this.setPosition(300, Math.pow(-1, this.cloneId) * Math.randomBetween(150, 200));
- this.show();
- while(game)
- {
- this.glideSecondsTo(4,-300,this.y);
- if(this.cloneId == 1 && game)
- {
- score++;
- Circle.sayScore();
- }
- this.setPosition(300,Math.pow(-1,this.cloneId)* Math.randomBetween(150,200))
- }
- }
- when cloned
- {
- while(game)
- {
- if(this.touchingPrecisely("Walrus"))
- {
- gameOver();
- }
- }
- }
- }
- actor gameOver
- {
- costume Game_Over_1("gallery:Characters/Game Over 1")
- when stage.started
- {
- this.hide();
- }
- }
- actor Circle
- {
- costume Red("gallery:Objects/Ring Red")
- when stage.started
- {
- this.hide();
- this.setPosition(-300,150);
- }
- function sayScore()
- {
- this.think(score);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement