Triggers

Triggers can be used to fire logic when an Actor intersects with a Collider, this is useful for in game switches, doors, or other in game sensors.

Trigger

const trigger = new ex.Trigger({
  width: 100,
  height: 100,
  pos: ex.vec(100, 100),
  action: () => {
    console.log('triggered')
  },
})