Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

structures.js 433B

1234567891011121314151617
  1. import Structure from "./Structure.js";
  2. export default {
  3. floor: (width) => {
  4. let attrs = [ "collides" ];
  5. if (width <= 1) {
  6. return new Structure(attrs, [ { x: 0, y: 0, tile: "grass-lr" }]);
  7. } else {
  8. return new Structure(attrs, [
  9. { x: 0, y: 0, tile: "grass-l", },
  10. Array.from({ length: width - 2 }, (_, i) =>
  11. ({ x: i + 1, y: 0, tile: "grass" })),
  12. { x: width - 1, y: 0, tile: "grass-r" },
  13. ]);
  14. }
  15. },
  16. }