utils   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 10
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A load_texture() 0 4 2
1
import pygame
2
3
TEXTURES_PATH: str = "assets/textures"
4
5
6
def load_texture(file: str, alpha: bool = True) -> pygame.Surface:
7
    """Loads a asset from a file and convert it into a pygame.Surface."""
8
    surface = pygame.image.load(f'{TEXTURES_PATH}/{file}')
9
    return surface.convert_alpha() if alpha else surface.convert()
10