1
votes

I'm developing a tile based iOS game. Objects (UIViews) are drawn above the tile map and should walk around, tile by tile.

I'm using a simple UIView animation to do that:

[UIView animateWithDuration:0.20 delay:0 options:UIViewAnimationOptionCurveLinear animations:^(void) {
    // set frame
    // set rotation
} completion:^(BOOL finished){
    // call method to start animation again
}];

The problem is that even when only animating about 5 objects it isn't smooth. After each animation there is a very small pause. Because it should be perceived as one animation (not tile by tile) it is noticable.

I need to do some checks for each move (1 move = 1 tile), so I can't just use one big animation. The checks are done independently and should update the data before the animation is finished. So I don't think the lag is because of that.

Are there any other ways on solving this? Maybe with Sprite Kit?

1

1 Answers

0
votes

Even when I rewrote the animation logic so that the animation distance would be as long as possible it was still very jerky with a few objects. It seems that animating multiple UIImageViews with transparency isn't a very good idea.

I'm now using Sprite Kit and everything is smooth and running at 60fps. It wasn't a big change, as Sprite Kit is quite simular.