Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stage {
- backdrop White("gallery:General/White")
- let matrix = [];
- let grid = 9;
- let game = false;
- function creatematrix() {
- for(let i = 1; i <= grid + 2; i++) {
- let list = [];
- for(let j = 1; j <= grid + 2; j++) {
- list.push(0);
- }
- matrix.push(list);
- }
- }
- function cloning(n) {
- for(let i = 1; i <= n; i++) {
- createClone(Square);
- }
- }
- function showmatrix() {
- let y = 150;
- for(let i = 1; i <= grid; i++) {
- let x = -50;
- for(let j = 1; j <= grid; j++) {
- let item = matrix[i][j];
- item.setPosition(x, y);
- item.show();
- x += 29;
- }
- y -= 29;
- }
- }
- actor Robot {
- costume GameOver("gallery:Text/Game Over 1")
- costume Winner("gallery:Text/Winner Blue")
- when stage.started {
- this.hide();
- this.size = 50;
- this.setPosition(-200, 0);
- matrix = [];
- creatematrix();
- cloning((grid + 2) * (grid + 2));
- Ball.say("");
- showmatrix();
- }
- }
- actor Square {
- costume One("gallery:Text/One")
- costume Two("gallery:Text/Two")
- costume Three("gallery:Text/Three")
- costume Four("gallery:Text/Four")
- costume Five("gallery:Text/Five")
- costume Six("gallery:Text/Six")
- costume Seven("gallery:Text/Seven")
- costume Eight("gallery:Text/Eight")
- costume Blue("gallery:Objects/Square Blue")
- costume Grey("gallery:Objects/Square Grey")
- costume Bomb("gallery:Objects/Bomb Explode")
- let i = 0;
- let j = 0;
- when stage.started {
- this.hide();
- this.size = 100;
- }
- when cloned {
- this.setCostume(9);
- let id = this.cloneId - 1;
- j = id % (grid + 2);
- i = (id - j) / (grid + 2);
- matrix[i][j] = this;
- }
- }
- actor Ball {
- costume Green("gallery:Objects/Ball Green")
- costume Red("gallery:Objects/Ball Red")
- when stage.started {
- this.setPosition(-200, -100);
- this.setCostume(2);
- this.say("Minesweeper game: try to avoid bombs and uncover all other tiles!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement