I want to basically create a animation, and when I pass in an integer a specific point of the animation is shown. For example a possible animation is of a sun setting. When I pass in 1 (the beginning), I would like to see the sun starting to set. However, when I pass in 10, I would like to see the sun completely set. Similarly, passing in different integer values should display different parts of the animation cycle.
Does anyone know how to create an animation? (I have absolutely no experience in creating animations, and have no idea what to do) Do I need to manually draw each frame? How would I bring the frames together to create the “animation”? Also, how could I control the animation with an integer value as demonstrated above?
I am not looking for code examples, just a general guideline of what needs to be done. I am using Objective C Cocoa, and creating this application on Mac OS X Snow Leopard, but want a solution that could work on all Mac versions (i.e. Mac OS X Lion).
There are a lot of ways to create animations. For example, you can draw a series of images and simply display them in order at a given rate, like a movie. Another way is to write code that knows how to construct an image given one or more parameters, as in sprite animation.
I think your best bet is to look for a basic sprite animation library and start playing with it. I haven’t used it myself, but Cocos2D has a very good reputation and seems pretty easy to get started with.