Object rendering

Computers store images in the form of grids of colors. Mostly, RGB (red, green, and blue) are enough to provide information for pixels. But apart from RGB values, there is another component of an image that is useful when dealing with pygame game development, which is alpha information (usually known as attribute components). The alpha information represents image transparency. This extra bit of information is quite useful; what usually happens in the case of pygame is that we normally draw or place one image on top of another with the alpha property activated. By doing this, we can see part of the background through it. We normally use third-party software such as GIMP in order to make an images' background transparent. ...

Get Learning Python by Building Games now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.