UNPKG

hytopia

Version:

The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.

64 lines (31 loc) 1.15 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [server](./server.md) &gt; [WorldManager](./server.worldmanager.md) &gt; [createWorld](./server.worldmanager.createworld.md) ## WorldManager.createWorld() method Creates and starts a new world with a unique ID. Use for: additional game rooms, arenas, or isolated simulations. Do NOT use for: deferred world creation without starting; this always starts. **Signature:** ```typescript createWorld(options: Omit<WorldOptions, 'id'>): World; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> options </td><td> Omit&lt;[WorldOptions](./server.worldoptions.md)<!-- -->, 'id'&gt; </td><td> The options for the world (ID is assigned automatically). </td></tr> </tbody></table> **Returns:** [World](./server.world.md) The created world. \*\*Side effects:\*\* Starts the world's tick loop and emits `WorldManagerEvent.WORLD_CREATED`<!-- -->. ## Remarks Auto-starts the world after creation.