cheesey
cheesey

Reputation: 516

Sprite-kit action using blocks

What I have:

What I'm going for:

Upvotes: 2

Views: 91

Answers (1)

sangony
sangony

Reputation: 11696

To make the ball move up a certain distance and come back down on its own accord, use applyImpulse with your node.

// modify the dy value (100) to whatever value suits your needs
[myNode.physicsBody applyImpulse:CGVectorMake(0, 100)];

As long as your node is affected by gravity, it will eventually come back down.

Upvotes: 2

Related Questions