SiliconGhetto Engine API
    Preparing search index...

    Function spawn

    • Spawn a new entity at the given position with optional sprite and collision.

      Parameters

      • opts: SpawnOpts = {}

        Entity configuration (position, sprite, collision box, tag, texture)

      Returns number

      The entity ID, used to reference this entity in other functions

      const player = sg.spawn({ x: 100, y: 200, sprite: { w: 32, h: 32, r: 1, g: 0, b: 0 } });