Skip to content

five-on-it / packages/sim/src/world / createSimWorld

Function: createSimWorld() ​

createSimWorld(level, rules?, items?): SimWorld

Defined in: packages/sim/src/world.ts:253

Builds a world from a level: the ground slab and one collider per placed mesh that collides, in the level's order (nail strips and roads have no collider), then the light pieces, each planted on a body of its own (breakables.ts), then the doors, shut (doors.ts), then the security cameras, on (cameras.ts). The rules are a game's (free roam's by default), the items the room's (the common ones by default); the server and every client build their worlds with the same. The level's containers and pickups are the server's to spawn.

Parameters ​

level ​

LevelData

rules? ​

Partial<SimRules> = FREE_ROAM

items? ​

readonly ItemDef[] = COMMON_ITEMS

Returns ​

SimWorld