Advertisement
Guest User

asdasdasdasdasdasdasdadsasdasasd

a guest
Jan 18th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. stage {
  2. backdrop White("gallery:General/White")
  3. let list = [ ];
  4. let numlist = [ ];
  5. let pos = 0;
  6. let points = 0;
  7. let round = false;
  8. let numVal = 0;
  9.  
  10. actor Négyzet {
  11. costume Barna("gallery:Objects/Square Brown")
  12. costume Fehér("gallery:Objects/Square White")
  13. costume Fekete("gallery:Objects/Square Black")
  14. costume Kék("gallery:Objects/Square Blue")
  15. costume Lila("gallery:Objects/Square Purple")
  16. costume Narancs("gallery:Objects/Square Orane")
  17. function genNum() {
  18. let num = 1;
  19. do {
  20. num = stage.ask("számot");
  21. numVal = Math.floor(num);
  22. numlist.push(numVal);
  23. if(num == 0) {
  24. numlist.pop;
  25. }
  26. } while(num != 0 && numlist.length != 9);
  27. }
  28. function blockSort() {
  29. for(let i = 1; i < numlist.length; i++) {
  30. let ind = 0;
  31. let floor = 0;
  32. while(list[ind] != 0) {
  33. floor += 1;
  34. if(numlist[i] < list[ind]) {
  35. ind += floor;
  36. this.x -= 30;
  37. this.y += 30;
  38. }
  39. else {
  40. ind += (floor + 1);
  41. this.x += 30;
  42. this.y += 30;
  43. }
  44. }
  45. list[ind] = numlist[1];
  46. createClone(this);
  47. this.wait(0.5);
  48. pos += 1;
  49. this.setPosition(0, -100);
  50. }
  51. }
  52. function gameStart() {
  53. Csillag.deleteAllClones()
  54. Csillag.wait(0.1)
  55. createClone(Csillag)
  56. Négyzet.deleteAllClones()
  57. numlist = []
  58. list = []
  59. pos = 0
  60. this.wait(0.1)
  61. this.size = 100
  62. this.setPosition(0, -100)
  63. showVariable(ref numlist)
  64. this.genNum()
  65. for(let i = 1; <= 45; i++){
  66. list.push(0)
  67. }
  68. list[0] = numlist[0]
  69. createClone(this)
  70. this.wait(0.5)
  71. pos += 1
  72. this.blockSort()
  73. this.wait(1)
  74. if(points == 500){
  75. stage.broadcast("win")
  76. }
  77. this.wait(1)
  78. if(round){
  79. gameStart()
  80. }
  81. }
  82. when stage.started {
  83. this.show();
  84. round = true;
  85. this.gameStart();
  86. }
  87. }
  88.  
  89. actor Csillag {
  90. costume Alap("gallery:Galaxy/Star Idle")
  91. }
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement