Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

46 Zeilen
949 B

  1. define([
  2. 'js/rendering/spritePool'
  3. ], function (
  4. spritePool
  5. ) {
  6. return function () {
  7. let map = this.map;
  8. let w = this.w = map.length;
  9. let h = this.h = map[0].length;
  10. this.stage.removeChild(this.layers.hiders);
  11. this.layers.hiders = new PIXI.Container();
  12. this.layers.hiders.layer = 'hiders';
  13. this.stage.addChild(this.layers.hiders);
  14. let container = this.layers.tileSprites;
  15. this.stage.removeChild(container);
  16. this.layers.tileSprites = container = new PIXI.Container();
  17. container.layer = 'tiles';
  18. this.stage.addChild(container);
  19. this.stage.children.sort((a, b) => {
  20. if (a.layer === 'hiders')
  21. return 1;
  22. else if (b.layer === 'hiders')
  23. return -1;
  24. else if (a.layer === 'tiles')
  25. return -1;
  26. else if (b.layer === 'tiles')
  27. return 1;
  28. return 0;
  29. });
  30. spritePool.clean();
  31. this.sprites = _.get2dArray(w, h, 'array');
  32. this.map = [];
  33. this.w = 0;
  34. this.h = 0;
  35. delete this.moveTo;
  36. };
  37. });