Monday, August 29, 2011

Another pygame example for audiogame programming

[Edit: if the sounds are not played at the expected moment (pygame > 1.7.1), this might be caused by a large default buffer length; in that case add pygame.mixer.pre_init(22050, -16, 2, 1024) before pygame.init(); more details there]


Example 3: move an object to the left or to the right with the arrow keys

This is a basic game loop, at last. I might try to simplify it further.

You can download all the examples (with the sounds) here.