Advertisement Jump to content


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


bitmap loading for animations

This topic is 6577 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

I have read Tricks of the Windows Game Programming Gurus and Windows Game Programming for Dummies. I understand most of the things in these books except working with animation. I was modifying the Underworld (a 2d, top down view demo game) and wanted to add a walk north and walk south animation in addition to the walk east and west animations. This is where I am stuck. In the books it says to define animations you do this... int anim walk[] = {0,1,2,1,0}; But the game does this... // animations for poos: bounce, crush, burrow int poo_anims[5][4] = { {0,1,-1,-1}, {2,3,-1,-1}, {4,5,-1,-1}, {6,7,-1,-1}, {8,9,10,9} }; Can anyone please tell me 1. What the numbers between the brackets mean. 2. Why there are negative numbers between the braces. Thank you.

Share this post

Link to post
Share on other sites
I haven''t read the book so I don''t know exactly what it''s trying to do.

Basically it''s declaring a two dimensional array, the extra brackets seperate the dimensions

The first set of numbers, {0,1,-1,-1} go into elements poo[0][0], poo[0][1], poo[0][2] and poo[0][3] respectively

The second set of numbers, {2,3,-1,-1} goes into poo[1][0], poo[1][1] ....

and the last set, {8,9,10,9} into poo[4][0], ..... poo[4][3]

The -1''s are probably a code to the program to tell it that no more frames exist, i.e. the first set {0,1,-1,-1} has only two frames, 0 and 1.


Share this post

Link to post
Share on other sites
Thanks for the help but I still don''t really understand. I know he is defining bitmaps for animation using the EXTRACT_MODE_CELL but I still wonder about the -1 because it was not used in the first example. Has anyone used the GPDUMB engine in their games?

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!