Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stage {
- scene White("gallery:Generic/White")
- let ROW = 6;
- let Cols = 12;
- let matr = 0;
- actor Robot {
- costume Idle("gallery:Figures/Robot Idle")
- @editorPosition(100, 100)
- function CreateMatrix(rows, cols) {
- let i = 0;
- let matr = [];
- while(i < rows) {
- let list = [];
- let j = 0;
- while(i < rows) {
- list.push(0);
- j++;
- }
- matr.push(list);
- i++;
- }
- }
- @editorPosition(100, 100)
- function ShowMatrix(rows, cols) {
- let i = 0;
- let Y = 130;
- while(i < rows) {
- let j = 0;
- let X = -280;
- while(j < cols) {
- let item = matr[i][j];
- item.setPosition(X, Y);
- item.setCostume(Math.randomBetween(1, 3));
- item.show();
- X += 50;
- j++;
- }
- Y -= 50;
- i++;
- }
- }
- @editorPosition(100, 100)
- function CreateClones(N) {
- for(let i = 1; i <= N; i++) {
- stage.createClone(Button);
- }
- }
- @editorPosition(10, 10)
- when stage.started {
- CreateMatrix(ROWS, COLS);
- CreateClones(ROWS * COLS);
- this.hide();
- ShowMatrix(ROWS, COLS);
- }
- }
- actor Gomb {
- @bubblePosition(0.7, 0.65)
- costume Blue("gallery:Objects/Button Blue")
- @bubblePosition(0.7, 0.65)
- costume Lilac("gallery:Objects/Button Purple")
- @bubblePosition(0.7, 0.65)
- costume Green("gallery:Objects/Button Green")
- when cloned {
- let id = this.cloneId - 1;
- let j = id % COLS;
- let i =(id - j)/ COLS;
- matr[i][j] = this;
- }
- when stage.started{
- this.hide();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement