Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stage {
- backdrop White("gallery:General/White")
- let list = [ ];
- let yellow = 0;
- actor Labda {
- default costume Yellow("gallery:Objects/Ball Yellow")
- costume Green("gallery:Objects/Ball Green")
- costume Red("gallery:Objects/Ball Red")
- when cloned {
- this.setCostume(Math.randomBetween(1, 3));
- if(this.costumeId == 1) {
- yellow++;
- }
- this.setPosition(Math.randomBetween(-280, 230), Math.randomBetween(-120, 120));
- this.show();
- while(true) {
- if(list[this.cloneId]) {
- this.goTo(Pointer);
- }
- }
- }
- when cloned {
- while(true) {
- if(this.touching(Coffer)) {
- if(this.costumeId == 1) {
- yellow--;
- this.deleteClone();
- }
- else {
- this.setPosition(Math.randomBetween(-280, 230), Math.randomBetween(-120, 120));
- list[this.cloneId] = false;
- }
- }
- }
- }
- when stage.started {
- this.hide();
- yellow = 0;
- list = [ ];
- list.push(false);
- for(let i = 1; i <= 15; i++) {
- createClone(this);
- list.push(false);
- }
- }
- when clicked {
- list[this.cloneId] = !list[this.cloneId];
- }
- }
- actor Coffer {
- costume Open("gallery:Objects/Coffer Open")
- costume Closed("gallery:Objects/Coffer Closed")
- when stage.started {
- this.setPosition(250, 120);
- while(true) {
- if(yellow == 0) {
- this.setCostume(this.Closed);
- }
- else {
- this.setCostume(this.Open);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement