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开发者_JAVA百科 do you need to create a new path and new animation and replace the old one?
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.
精彩评论