You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

structures.js 407B

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