clik-engine API
    Preparing search index...

    Class EntityFactory

    Factory for creating entities from registered prefabs. Define a prefab once, spawn instances by name.

    Usage:

    factory.register('enemy', (scene, x, y) => {
    const e = new Entity(scene, x, y);
    e.entityType = 'enemy';
    e.addComponent('health', new Health(50));
    e.addComponent('patrol', new Patrol([...]));
    return e;
    });

    const enemy = factory.create('enemy', 100, 200);
    Index

    Constructors

    Methods