Game Development with Python and Pygame

  1. Working with Images and Sprites
    1. Loading and Displaying Images
      1. Supported Image Formats
        1. PNG Format
          1. JPEG Format
            1. GIF Format
              1. BMP Format
              2. The pygame.image.load() Function
                1. Loading Images from Files
                  1. Error Handling for Image Loading
                    1. Loading from File-Like Objects
                    2. Blitting Images onto Surfaces
                      1. The blit() Method
                        1. Positioning Images
                          1. Blitting with Special Flags
                          2. Image Transparency and Alpha Channels
                            1. Per-Pixel Alpha
                              1. Colorkey Transparency
                                1. Alpha Blending
                                2. Converting Surfaces for Performance
                                  1. Using convert()
                                    1. Using convert_alpha()
                                      1. Performance Implications
                                    2. Introduction to Sprites
                                      1. The Concept of a Sprite in Games
                                        1. Definition and Role of Sprites
                                          1. Static vs. Animated Sprites
                                          2. The pygame.sprite.Sprite Class
                                            1. Inheriting from Sprite
                                              1. Sprite Lifecycle
                                                1. Required Attributes
                                                2. Creating a Custom Sprite Class
                                                  1. The image Attribute
                                                    1. Assigning Images to Sprites
                                                    2. The rect Attribute
                                                      1. Positioning and Collision
                                                      2. The update() Method
                                                        1. Custom Update Logic
                                                        2. Additional Sprite Properties
                                                      3. Managing Sprites with Groups
                                                        1. The pygame.sprite.Group Class
                                                          1. Creating Sprite Groups
                                                            1. Group Methods Overview
                                                            2. Adding and Removing Sprites from a Group
                                                              1. Adding Sprites
                                                                1. Removing Sprites
                                                                  1. Sprite Group Membership
                                                                  2. Updating All Sprites in a Group
                                                                    1. Calling update() on Groups
                                                                      1. Passing Arguments to update()
                                                                      2. Drawing All Sprites in a Group
                                                                        1. Using draw() Method
                                                                          1. Custom Drawing Methods
                                                                          2. Specialized Group Classes
                                                                            1. LayeredUpdates
                                                                              1. OrderedUpdates
                                                                                1. RenderUpdates