Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stage {
- backdrop White("gallery:General/White")
- let score = 0;
- let game = true;
- let v = 0;
- function gameOver() {
- this.game = false;
- this.Rozmár.hide();
- this.Tégla.getClone(1).hide();
- this.Tégla.getClone(2).hide();
- this.Game_Over.show();
- }
- when started {
- this.game = true;
- this.score = 0;
- }
- actor Rozmár {
- costume Alap("gallery:Animals/Walrus Idle")
- costume Mozog("gallery:Animals/Walrus Move")
- when stage.started {
- while (game) {
- v--;
- this.y += v;
- this.wait(0.05);
- }
- }
- when stage.keyPressed("space"){
- v = 10;
- for (let i = 1; 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(Edge.any)) {
- gameOver();
- }
- }
- }
- }
- actor Tégla {
- costume Tégla_1("gallery:Objects/Brick 1")
- when stage.started {
- this.hide();
- this.heading = 0;
- createClone(this);
- createClone(this);
- }
- when cloned {
- this.setPosition(300, Math.pow(-1, cloneId) * Math.randomBetween(150, 200));
- this.show();
- while(game) {
- this.glideSecondsTo(4, -300, this.y);
- if(this.cloneId == 1 && game) {
- score += 1;
- Karika.sayScore();
- }
- this.setPosition(300, Math.pow(-1, cloneId) * Math.randomBetween(150, 200));
- }
- }
- when cloned {
- while(game) {
- if(this.touching(Rozmár)) {
- gameOver();
- }
- }
- }
- }
- actor Game_Over {
- costume Game_Over_1("gallery:Text/Game Over 1")
- when stage.started {
- this.hide();
- }
- }
- actor Karika {
- costume Piros("gallery:Objects/Ring Red")
- function sayScore() {
- this.think(score);
- }
- when stage.started {
- this.hide();
- this.setPosition(-300, 150);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement