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

[pygame] p4a animation lag



I've got a pretty simple animation running on p4android, but it's
lagging pretty badly.

The code is basically, get a screen touch, run 3 animation frames with
a tick of 10, so it should be pretty snappy. On the computer it's fast
enough but the android it's noticeably slower, to the point where
really the game would be unplayable. chug-chug-chug go the frames,
basically.

This is a Sprint Hero with android 2.1 or 2.2, can't remember exactly.
Am I just running into limitations on the platform? Any optimization I
can do for the android side?

If you want the code I can dig it up but it's just a simple animation
loop along the lines of

frames = [image1, image2, image3]
running = True
while running:
    for event in pygame.event.get():
        if event.type == MOUSEBUTTONDOWN:
            clock.tick(10)
            for img in frames:
                screen.blit(background, (0,0))
                screen.blit(img, position)
                pygame.display.flip()
                clock.tick(10)





-- 
A musician must make music, an artist must paint, a poet must write,
if he is to be ultimately at peace with himself.
- Abraham Maslow