Serethos
Junior Devvie  
Java games rock!
|
 |
«
Posted
2004-01-01 19:21:52 » |
|
i have a little problem animating my sprites. every game-object has several animator-objects each storing a list of animation-frames for a special sprite-movement. these animator-objects can differ through nested classes, so theres one for looping animation, one for one-shot and so on.
now imaging my "main-class", my game-manager, which schedules all game-objects. if an event occurs, e.g. pressing a key, collision, whatever, the gamemanager signals it to the game-objects so that they know, they have to change the animation-strip.
for getting the correct animationstrip there is an object which gets a reference of the actual animation. so the animator-object actual_anim is set to shoot_anim, walk_anim ... whatever shall be returnd for painting over this dummy.
but now the big problem: every call to an object that it shall change its animation is done just in time. imaging a memory card game: the first "animation" is a card, where you can only see the deck-motive. after clicking, the card shall turn in a little animation and then change its animation to a "heart 8" (or whatever). my program would solve it this way:
animation references to 'hidden_card' click on card recognized => animation is set to ?? either : open_card -- now the turn-animation is missing or : turn_card -- no i have to develope a system which detects when the turn_animation has ended and through which animation it sould be replaced (it hasnt to be always the same in all cases)
the turn_animation has no clue, that is going to be replaced. even if it did so it would not know, which animation should follow...
|