Class

GKGridGraphNode

A node in a navigation graph, associated with a position on a discrete two-dimensional grid.

Declaration

@interface GKGridGraphNode : GKGraphNode

Overview

Together, a network of nodes form a graph that describes the navigability of a game world. Use graph nodes with a GKGridGraph object (and methods of its superclass GKGraph) to perform actions that relate to the network of nodes as a whole, such as pathfinding to determine routes through the network.

To learn more about graphs and pathfinding, see Pathfinding in GameplayKit Programming Guide.

Topics

Creating a Graph Node

- initWithGridPosition:

Initializes a graph node with the specified position on a grid.

+ nodeWithGridPosition:

Creates a graph node with the specified position on a grid.

Inspecting a Node’s Position

gridPosition

The position of the node on a discrete integer grid.

Relationships

Inherits From

See Also

Pathfinding

GKGraph

A collection of nodes that describes the navigability of a game world and provides pathfinding methods to search for routes through that space.

GKObstacleGraph

A navigation graph for 2D game worlds that creates a minimal network for precise pathfinding around obstacles.

GKMeshGraph

A navigation graph for 2D game worlds that creates a space-filling network for smooth pathfinding around obstacles.

GKGridGraph

A navigation graph for 2D game worlds where movement is constrained to an integer grid.

GKGraphNode

A single node in a navigation graph for use in pathfinding.

GKGraphNode2D

A node in a navigation graph, associated with a point in continuous 2D space.

GKGraphNode3D

A node in a navigation graph, associated with a point in continuous 3D space.