Overview
Entities are uniquely identified collections of components. They represent everything in your game world: players, characters, NPCs, items, UI elements, and terrain. Entities have no logic themselves - they’re simply containers for components.Entity Structure
Creating Entities
Character Entities
Characters are playable entities controlled by players:core/src/games/island/Ian.ts
Player Entities
Players are persistent entities that control characters:core/src/ecs/entities/players/Player.ts
Item Entities
Items are entities that can be held in inventory:core/src/ecs/actions/attacks/Blaster.ts
UI Entities
HTML Overlay
3D UI Element
core/src/ecs/entities/ui/ThreeText.ts
Terrain Entities
core/src/ecs/entities/terrain/LineWall.ts
Entity Lifecycle
Entity Patterns
Factory Functions
Create reusable entity templates:Composition
Build complex entities from simple parts:Best Practices
Unique IDs
Always use unique entity IDs. Include type and instance:
"enemy-1", "player-abc123".Factory pattern
Use factory functions to create entities with consistent configurations.
Minimal components
Only add components that the entity actually needs.
Networked flag
Add Networked() component to entities that should sync across clients.
Next Steps
Components
Learn about component types
Actions
Add interactive behaviors
Systems
Process entities with systems