Logan Jahnke
Logan Jahnke

Reputation: 817

How to create a wall using SpriteKit?

How do you create a wall that follows your touch?

I currently create multiple nodes that are all small circles "brick.png", but I would prefer it to be continuous and only one node to save memory.

Currently creates:

Small Nodes

I want the circles near the goal to be a continuous line requiring one node.

Any help?

Upvotes: 0

Views: 304

Answers (1)

Vandilson Lima
Vandilson Lima

Reputation: 54

SpriteKit has SKShapeNode. You can use it to draw a CGPath on the screen. In thochesMoved you recalculate the path and set to the path property.

Upvotes: 3

Related Questions