Advertisement
Guest User

Untitled

a guest
Dec 12th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. stage {
  2. backdrop White("gallery:General/White")
  3. let list = [ ];
  4. let yellow = 0;
  5.  
  6. actor Labda {
  7. default costume Yellow("gallery:Objects/Ball Yellow")
  8. costume Green("gallery:Objects/Ball Green")
  9. costume Red("gallery:Objects/Ball Red")
  10. when cloned {
  11. this.setCostume(Math.randomBetween(1, 3));
  12. if(this.costumeId == 1) {
  13. yellow++;
  14. }
  15. this.setPosition(Math.randomBetween(-280, 230), Math.randomBetween(-120, 120));
  16. this.show();
  17. while(true) {
  18. if(list[this.cloneId]) {
  19. this.goTo(Pointer);
  20. }
  21. }
  22. }
  23. when cloned {
  24. while(true) {
  25. if(this.touching(Coffer)) {
  26. if(this.costumeId == 1) {
  27. yellow--;
  28. this.deleteClone();
  29. }
  30. else {
  31. this.setPosition(Math.randomBetween(-280, 230), Math.randomBetween(-120, 120));
  32. list[this.cloneId] = false;
  33. }
  34. }
  35. }
  36. }
  37. when stage.started {
  38. this.hide();
  39. yellow = 0;
  40. list = [ ];
  41. list.push(false);
  42. for(let i = 1; i <= 15; i++) {
  43. createClone(this);
  44. list.push(false);
  45. }
  46. }
  47. when clicked {
  48. list[this.cloneId] = !list[this.cloneId];
  49. }
  50. }
  51.  
  52. actor Coffer {
  53. costume Open("gallery:Objects/Coffer Open")
  54. costume Closed("gallery:Objects/Coffer Closed")
  55. when stage.started {
  56. this.setPosition(250, 120);
  57. while(true) {
  58. if(yellow == 0) {
  59. this.setCostume(this.Closed);
  60. }
  61. else {
  62. this.setCostume(this.Open);
  63. }
  64. }
  65. }
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement