Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. if($this.scene.state() == "PLAY"){
  2.  
  3. $this.x_spacer = 150;
  4. $this.y_spacer = 50;
  5. $this.tileDist = 100;
  6.  
  7. $this.allTiles=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0];
  8.  
  9.  
  10. for(var x=1; x<=4; x++){
  11. for(var y=0;y<=3;y++){
  12. var tileNum = x+y*4;
  13. if(tileNum <16){
  14. var tile = $this.findName("tile"+tileNum);
  15. tile.x(x*$this.tileDist+$this.x_spacer);
  16. tile.y(y*$this.tileDist+$this.tileDist+$this.y_spacer);
  17. }
  18. }
  19. }
  20. for (var shuffle=0;shuffle<500;shuffle++){
  21. var tileNum = Math.round(random(15,1));
  22. $this.scene.checkMove(tileNum);
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement