ecspresso
    Preparing search index...

    Function hasDetectedTargets

    • Check whether an entity has any detected targets.

      Parameters

      • ecs: {
            getComponent(
                entityId: number,
                name: "detectedEntities",
            ): DetectedEntities | undefined;
        }

        ECS world instance

      • entityId: number

        Entity with a detector component

      Returns boolean

      true if detectedEntities contains at least one entry

      if (hasDetectedTargets(ecs, guardId)) {
      // transition to chase
      }