Archived

This topic is now archived and is closed to further replies.

Animation

This topic is 6363 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

A nice explaination about animation in games would be nice. Let''s say you have a dog sprite with 3 frames for walking and a cat sprite with 5 frames for jumping, how would you animate them both at the sametime on screen? Would be sprite need to have a function something the Animate()? if so how would it work? In the book "Windows Game Programming for Dummies", it mentioned a BOB or something like that. I couldn''t understand how it works. And about the GPDUMB engine, there was no codes for the functions to explain and give a little example. HELP!!!!!!!!!!!!!!!!

Share this post


Link to post
Share on other sites
First start be maintaining a list of animations that are currently being displayed. Every program loop (this can't be event based unless you are using a timer) draw the next frame in the animations if the delay has reached 0. If you try to draw a new frame of the animation every program loop the animation will play too fast, so you will have to use delays.

psuedo-code:
for every program loop:
--- for every animation
------ if delay > 0 then delay--
------ if (delay == 0):
----------- animation_frame++;
----------- delay = 10 <---whatever the delay is
------ draw animation's current frame at x,y

hope this helped


Edited by - neverlast on July 16, 2000 6:02:14 PM

Share this post


Link to post
Share on other sites
A BOB is something that the author of the book kind of made up basically.

He makes functions that basically do the Directx stuff for you for the most part.



"The road of excess leads to the palace of wisdom." --William Blake

"The road of excess also just ends making me tired because I'm too lazy" --Nazrix

Share this post


Link to post
Share on other sites