6 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for vegaseat
Member Avatar for vegaseat

A very basic pygame sprite example. Moving a sprite with the arrow keys, could be the start of a great space game.

0
6K
Member Avatar for vegaseat

This simple code shows how to write text with a given font, font size and color using the module pygame ...

Member Avatar for lsallen
4
7K
Member Avatar for vegaseat

Just a code sample that allows you to play your midi or mp3 music files with Python and module pygame.

4
2K
Member Avatar for vegaseat

If you draw shapes that are closely spaced and shifted, you can create interesting interference patterns, so called moire patterns. Here is an example using the Python module PyGame to do the drawing.

2
726
Member Avatar for god0fgod

I've created a few functions to be used with pygame which are based on anti-aliased curves. At the moment and likely forever, it has two useful functions: aacircle(s,x,y,r,colour): Draws an anti-aliased circle on the surface s at the starting point x and y with the radius r. The circle will …

0
759

The End.