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.

tiles.js 329B

1234567891011121314
  1. export default {
  2. fromLine: function(width, tile) {
  3. if (width <= 1) {
  4. return [ { x: 0, y: 0, tile: tile+"-lr" }];
  5. } else {
  6. return [
  7. { x: 0, y: 0, tile: tile+"-l", },
  8. Array.from({ length: width - 2 }, (_, i) =>
  9. ({ x: i + 1, y: 0, tile: tile })),
  10. { x: width - 1, y: 0, tile: tile+"-r" },
  11. ];
  12. }
  13. },
  14. }