Skip to content

LevelAPI

Defined in: packages/threeplay/src/plugins/level/types.ts:55

API of the level plugin.

addLevel(map, opts): LevelObj

Defined in: packages/threeplay/src/plugins/level/types.ts:68

Builds a level from an ASCII map, one string per row:

addLevel(["#####", "#@ o#", "#####"], {
tiles: {
"#": () => [box(1, 2, 1), color("gray"), area(), body({ isStatic: true })],
"o": () => [sphere(0.3), color("gold"), area(), "coin"],
},
});

string[]

LevelOpts

LevelObj