Skip to content

laife.rendering.building_sprite

BuildingSprite - pygame visual representation of a Building.

Classes:

BuildingSprite

BuildingSprite(building: Building, *groups: Group)

Bases: Sprite

Pygame sprite that renders a Building entity.

Create a sprite surface for the given building.

Source code in src/laife/rendering/building_sprite.py
def __init__(self, building: Building, *groups: pygame.sprite.Group) -> None:
    """Create a sprite surface for the given building."""
    super().__init__(*groups)
    self.building = building
    alg.log(f"BUILD: Creating sprite for {self.building.name}")
    self._create_surface()