Fluid iPhone Animation ala Plants vs Zombies

If you played Plants vs Zombies, you saw how flexible and interesting character animation is. Can anyone guess how they do it? They don't seem to just bring animated bitmaps to life; the animation is too sharp even when the characters rotate and scale. The picture looks vectorial, but I can’t imagine that everything is looming using Core Graphics. Any ideas?

+3
source share
4 answers

My guess is: OpenGL. Core Graphics does not have iPhone performance for real-time vector graphics at this level of detail. From a quick look at PvZ graphics, I think they use separate bitmaps for body parts and zombies - for example, a peashooter consists of a base, a pair of leaves attached to it, a head and a stem (which bends back and forth like “head” beans). In other words, the bitmap images themselves do not change; they simply move and rotate in relation to each other, which is ideal for OpenGL.

+3
source

, , (.. PvZ), OpenGL - , . , , , runloop (.. Core Animation UIKit) Objective-C.

+1

, , , OpenGL , OpenGL.

- , cocos2d iPhone. OpenGL, Objective-C 2D-. , , , , .

+1

, CoreGraphics spritesheets.

0

Source: https://habr.com/ru/post/1745602/


All Articles