Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stage {
- backdrop White("gallery:General/White")
- let list = [ ];
- let numlist = [ ];
- let pos = 0;
- let points = 0;
- let round = false;
- let numVal = 0;
- actor Négyzet {
- costume Barna("gallery:Objects/Square Brown")
- costume Fehér("gallery:Objects/Square White")
- costume Fekete("gallery:Objects/Square Black")
- costume Kék("gallery:Objects/Square Blue")
- costume Lila("gallery:Objects/Square Purple")
- costume Narancs("gallery:Objects/Square Orane")
- function genNum() {
- let num = 1;
- do {
- num = stage.ask("számot");
- numVal = Math.floor(num);
- numlist.push(numVal);
- if(num == 0) {
- numlist.pop;
- }
- } while(num != 0 && numlist.length != 9);
- }
- function blockSort() {
- for(let i = 1; i < numlist.length; i++) {
- let ind = 0;
- let floor = 0;
- while(list[ind] != 0) {
- floor += 1;
- if(numlist[i] < list[ind]) {
- ind += floor;
- this.x -= 30;
- this.y += 30;
- }
- else {
- ind += (floor + 1);
- this.x += 30;
- this.y += 30;
- }
- }
- list[ind] = numlist[1];
- createClone(this);
- this.wait(0.5);
- pos += 1;
- this.setPosition(0, -100);
- }
- }
- function gameStart() {
- Csillag.deleteAllClones()
- Csillag.wait(0.1)
- createClone(Csillag)
- Négyzet.deleteAllClones()
- numlist = []
- list = []
- pos = 0
- this.wait(0.1)
- this.size = 100
- this.setPosition(0, -100)
- showVariable(ref numlist)
- this.genNum()
- for(let i = 1; <= 45; i++){
- list.push(0)
- }
- list[0] = numlist[0]
- createClone(this)
- this.wait(0.5)
- pos += 1
- this.blockSort()
- this.wait(1)
- if(points == 500){
- stage.broadcast("win")
- }
- this.wait(1)
- if(round){
- gameStart()
- }
- }
- when stage.started {
- this.show();
- round = true;
- this.gameStart();
- }
- }
- actor Csillag {
- costume Alap("gallery:Galaxy/Star Idle")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement