Spawn a new entity at the given position with optional sprite and collision.
Entity configuration (position, sprite, collision box, tag, texture)
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 } }); Copy
const player = sg.spawn({ x: 100, y: 200, sprite: { w: 32, h: 32, r: 1, g: 0, b: 0 } });
Spawn a new entity at the given position with optional sprite and collision.