CastleSeven / flappy-balloon

Flappy-Bird like game featuring a hot air balloon and a variety of obstacles.
0 stars 0 forks source link

Blitting and Transparency Issue Between Balloon and Obstacles #1

Open CastleSeven opened 9 years ago

CastleSeven commented 9 years ago

Known issue in the moments BEFORE a game over event, just as an obstacle is colliding with the player balloon. The obstacle's transparent box (part of the image) covers the balloon. I assume this is because the background is actually re-blitted only around the obstacles to boost performance, and as such the background is blitted around the balloon, then around the obstacles, and as such a portion of the background is seen THROUGH the balloon object. The attached picture illustrates the problem. I've seen other pygame code do this successfully with just the object and not the bounding box. Any tips? img_20151006_002304

horstjens commented 9 years ago

try to change the order of blitting. blit the obstacle (plane) first, than the ballon. Also you can try to blit the background on the whole screen first (each frame, overwriting all sprites), later do allsprites.update() and allsprites.blit(screen). allsprites is the name of the pygame spritegroup where all of your strites are in.