user189804
user189804

Reputation:

CAKeyframeAnimation with path; can the path be extended to extend the animation?

You would be familiar with the games where a train moves slowly along a track that is made from puzzle pieces - if you can't tile more pieces onto the track the train crashes and you lose. One way to do this would be to make the train follow a path defined in a CAKeyframeAnimation.

Once the animation is created and added to the layer can you extend the path? (Maybe by maintaining a hold on the CGPathRef and adding to it) Or do you need to create a new path and new animation and replace the old one?

Upvotes: 0

Views: 483

Answers (1)

user189804
user189804

Reputation:

Yes you can - the animation proceeds along the path with appended paths just fine. Now that problem is solved the new problem is how to make animation progress according to touch inputs, not elapsed time.

Upvotes: 1

Related Questions