Contents

obstacles(fromNodeBounds:)

Converts each node into an obstacle by transforming its bounds into the scene’s coordinate system.

Declaration

class func obstacles(fromNodeBounds nodes: [SKNode]) -> [GKPolygonObstacle]

Parameters

  • nodes:

    An array of Sknode objects.

Return Value

An array of GKPolygonObstacle objects.

Discussion

Use the array of obstacles to create an obstacle graph (GKObstacleGraph) in GameplayKit. See GameplayKit and GameplayKit Programming Guide.

See Also

Adding GameplayKit Behaviors