I have a question that I was wondering if someone could at least make a guess as to what the problem is with my program.
I'm designing an RPG with the bit blit function. The combat requires about 50 frames of animation (which means about 100 sprites and masks), between your character and the enemey.
I have all the masks and sprites in their own picture box on separate forms and use timers to change which frame should be displayed then another timer that redraws the combat screen and sprites every 10 miliseconds weather they have been changed or not by looking at a case statement then drawing the correct mask and sprite.
I also initialize all the drawing fuctions before the combat begins by drawing every single one onto the combat window then erasing them before the user can see it. This increases the performance, otherwise the first time you do a move it will be sluggish.
Now finally to the problem. I've found that one random frame always seems to get screwed up displaying a large black area, and will remain screwed up unless you turn off the computer entirely then turn it back on and try again. But this only happens sometimes other times not at all.
Can anyone guess what that problem might be what is going on?
I assume the hdc property or picture itself is somehow getting screwed up during the initilization process. To combat it I now replace every picture in the picture boxes with one from a resource file after the initalization takes place and I have never had that problem since. But I'd really like to know what is causing it, because I really don't understand.




Reply With Quote