|
From: Martin D. <ak...@cs...> - 2000-04-15 13:43:13
|
I was digging into KGB_AnimState last night when I realised that it's not
gonna work the way we planned. What we were aiming for was a KGB_AnimState
that would store pointers to SDL_Surface's along with the direction they
would the animated and what would happen when you reached the end of the
frames. The two main functions I had planned were:
int KGB_AnimState::animate(int lastFrame)
which returns the next frame in the sequence
and
SDL_Surface *KGB_AnimState::getFrame(int frame)
There are the KGB_AnimMotion types: KGB_DIRECT, KGB_CIRCULAR and
KGB_REVERSING.
The problem occurs with KGB_REVERSING. When a KGB_AnimState is in
KGB_REVERSING mode it moves backwards through the frames when it reaches
the end. However there is no way for the KGB_AnimState to know if it
should be reading the frames in reverse or forwards without setting the
direction variable in KGB_AnimState which would mess up anything else.
So now, each object will have to have its own KGB_AnimState, it'll only
add about 20 bytes to each sprite so i don't think it matters much
Long live the confused,
Akawaka.
--
Bother! A Pooh poo.
|