Search code examples
iphonexcode4core-animationcore-graphics

Concept behind Arcs Puzzle


Here video link for the Arc puzzle

Can anyone please tell me what concept is used behind this game. I have just started learning Iphone and this game is pretty cool. First I thought it might be using core animation and core graphics. But seeing the movement of the objects it looks much more complicated. Can anyone tell me what kind of approach do one need to build something like this.


Solution

  • That could very well be Core Animation. You could do the whole thing with CAShapeLayer objects. The code would probably be simplest if each "track/sector" of the arcs puzzle was a separate shape layer.

    With a shape layer, if you change the path that defines the shape, as long as the old path and the new path have the same number and type of control points, the change can be animated. Thus, you could animate rotating one of the tracks, (rotation transform around the center point for all track/sector shapes in the track) or animate sliding a track/sector in or out.