Create an Entity

For reusable gameplay entities, prefer the factory/lifecycle path.

  1. Define or reuse a blueprint.
  2. Register it in your factory.
  3. Create a SpawnDefinition.
  4. Request it through the lifecycle system.

Example factory:

class GameFactory(EntityFactory):
    registry = {
        "circle": CircleBlueprint,
    }

Definition:

"ball": SpawnDefinition(
    "circle",
    make_kwargs=lambda: {
        "position": Vec2(100, 100),
        "radius": 8,
    },
)

Initial placement:

yield EntitySpawn("ball")

Runtime systems should generally request spawning through LifecycleQueue.