1234567891011121314151617 |
- import Structure from "./Structure.js";
-
- export default {
- floor: (width) => {
- let attrs = [ "collides" ];
- if (width <= 1) {
- return new Structure(attrs, [ { x: 0, y: 0, tile: "grass-lr" }]);
- } else {
- return new Structure(attrs, [
- { x: 0, y: 0, tile: "grass-l", },
- Array.from({ length: width - 2 }, (_, i) =>
- ({ x: i + 1, y: 0, tile: "grass" })),
- { x: width - 1, y: 0, tile: "grass-r" },
- ]);
- }
- },
- }
|