Skip to main content
GameDev.net gamedev.net
🔒 Locked

Double buffering problem...I think

Started by aphid Dec 29, 2002 at 2:11 AM 0 replies 150+ views
Original Post
aphid
aphid
I am using Allegro currently and have run into a problem that I cannot get to go away. When my sprite is walking, it shows up fine. When I have no key presses though, the sprite disappears from the screen. My program is setup such that I clear the buffer at the beginning of the program. Then I do all my animations. After those are done, I draw the buffer. Then the whole loops starts again. I can''t understand why it is deleting my sprite when I am not moving it though. I think I''ve narrowed it down to when I am clearing the buffer. When I remove that piece of code, the sprite does not disappear but he leaves a white trail behind him when he walks. That white trail never goes away though. Someone else suggested I create a few constant variables such as "const int UP = 1", "const int DOWN = 2", etc...Then I compare them to an integer called direction. Depending on what direction the "integer direction" equals, it draws a frame of that directions animation. It did not work. I am totally out of ideas now. Anyone have any idea what could be wrong?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.