background flashing
I''ve finished the text-based game, but my friend and I are doing a 2D directx graphics game now. We have used two bitmaps and have them repeating going down the screen but the second bitmap always flashes and it''s not suppost to. It''s a 2D space ship going through a asteroid field from a top view, we need the background to show the ship is moving because it slowly travels down if you don''t push up.
"Flashes"?
->Suddenly disappears?
->Flickers?
->Appears/disappears?
My advice would be : read through your background rendering function again, and ask yourself these questions:
When do I draw that (1st or 2nd) piece of background here?
(It could happen that sometimes, you''re drawing no piece somewhere)
When do I send back each (bottom) piece to the top?
(Maybe you send the bottom piece too soon, when it should still be visible).
I assume your two bitmaps are half the screen height each. So drawing them toegether offers you no more than the screen height. So, if you offset them down, you''ll have a hole somewhere (top, or bottom of the screen). This means you would have to draw one of the bitmaps once (middle of the screen), and the other two times (half at the top of the screen, half at the bottom).
Good luck!
->Suddenly disappears?
->Flickers?
->Appears/disappears?
My advice would be : read through your background rendering function again, and ask yourself these questions:
When do I draw that (1st or 2nd) piece of background here?
(It could happen that sometimes, you''re drawing no piece somewhere)
When do I send back each (bottom) piece to the top?
(Maybe you send the bottom piece too soon, when it should still be visible).
I assume your two bitmaps are half the screen height each. So drawing them toegether offers you no more than the screen height. So, if you offset them down, you''ll have a hole somewhere (top, or bottom of the screen). This means you would have to draw one of the bitmaps once (middle of the screen), and the other two times (half at the top of the screen, half at the bottom).
Good luck!
In reply to ''ToohrVyk''
The answer to your question was that the 2nd background, bitmap flickers when it is displayed which may be because of it being over the top of the 1st bitmap, We don''t know? The bitmaps are (640,480) each, there is no spaces between them they must overlap in places, once again we don''t know?
The answer to your question was that the 2nd background, bitmap flickers when it is displayed which may be because of it being over the top of the 1st bitmap, We don''t know? The bitmaps are (640,480) each, there is no spaces between them they must overlap in places, once again we don''t know?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement