[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] OSX sprite flickering



Oh i also noticed sometimes they appear to half render as they move along and other weird artifacts like that, is it possibly because i call the update twice like this:

    #Update the moving sprites.
    if not tick % npc.UPDATERATE:
        people.update()
        reclist = people.draw(screen)
        pygame.display.update(reclist)
        people.clear(screen, clear_cb)

    if not tick % bullet.UPDATERATE:
        bullets.update()
        reclist = bullets.draw(screen)
        pygame.display.update(reclist)
        bullets.clear(screen, clear_cb)

I couldn't find a good way to efficiently combine the reclists and have it update them at the same time as i cant guarantee they will both exists that iteration so you cant do List + None.


On 20/01/2009, at 8:06 PM, Daniel Mateos wrote:

Nah that test seems to run fine but its not running fast enough to trigger it possibly, also it is only the Objects that inherit DirtySprite that flicker.

On 20/01/2009, at 7:39 PM, René Dudfield wrote:

hi,

does examples/test_sprite.py flicker as well?

It might be a double buffer Vs singler buffer issue... or maybe an
error in your code, or a bug in the sprite code.

Checking the example will eliminate some of those possibilities.

cheers,

On Tue, Jan 20, 2009 at 6:27 PM, Daniel Mateos <daniel@xxxxxxxxx> wrote:
Hey all, im getting this weird issue where my sprites flicker in OSX, especially when i add a bunch of new sprites and do some updates to the
display.

Code at http://github.com/dmateos/pybang/tree/master will duplicate the
issue, i have tested it on Linux/Windows and it works fine.


Daniel Mateos
daniel@xxxxxxxxx





Daniel Mateos
daniel@xxxxxxxxx




Daniel Mateos
daniel@xxxxxxxxx