[SDL] Quick Question about animation.
Bob Pendleton
bob at pendleton.com
Wed Mar 7 15:24:22 PST 2007
On Wed, 2007-03-07 at 16:33 -0600, Lamonte(Scheols/Demonic) wrote:
> Hello,
> I was wondering whats the best way to switch between 2 image frames
> every time I would press a key. For example, If I loaded 2 bitmaps
> one will have its foot back and the other would have its foot forward
> so if I would to keep running the frames back and forth it would look
> like my sprite was walking. Any suggestions on the BEST way to do
> this?
>
> Thanks in advanced for any suggestions giving.
> -Lamonte
>
How about drawing the first image, displaying it for a small amount of
time. Draw the second image, display it for a small amount of time.
Repeat until done?
Your question is very difficult to answer. The way you stated the
question implies that there exists a "best" way to do what you want and
that everyone reading the question knows what you mean by "best". There
isn't and we don't. Trying to find the "best" way is a never ending
quest because it doesn't exist. If you want to get the job done look for
a way that works and be happy with it.
Bob Pendleton
P.S.
If you have a negative emotional reaction to what I just said. Count to
1024 in binary on your fingers and then think about what I said. It was
not said to insult or injure but to help you avoid the most horrible
pitfall of programming. A trap I spent many years in before I realized
that the word "best" has no universal meaning.
--
+--------------------------------------+
+ Bob Pendleton: writer and programmer +
+ email: Bob at Pendleton.com +
+ web: www.GameProgrammer.com +
+ www.Wise2Food.com +
+ nutrient info on 7,000+ common foods +
+--------------------------------------+
More information about the SDL
mailing list