Link 节点到另一个节点 SpriteKit - Swift

Link node to an other node SpriteKit - Swift

我正在创建一个游戏,我有一个网格和一个球,我想让球跟随网格的位置,请看图片。

我该怎么做?

您应该将球添加为网格的子节点。例如:

grid.addChild(ball)

有关详细信息,请参阅文档中的创建节点树https://developer.apple.com/library/ios/documentation/GraphicsAnimation/Conceptual/SpriteKit_PG/Nodes/Nodes.html