2026-02-06 17:51:57 +00:00
|
|
|
import pygame
|
|
|
|
|
import os
|
2026-05-11 08:37:37 +00:00
|
|
|
|
|
|
|
|
BASE_IMG_PATH: str = 'data/images/'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def load_image(path: str) -> pygame.Surface:
|
2026-03-04 15:50:44 +00:00
|
|
|
img = pygame.image.load(BASE_IMG_PATH + path).convert()
|
|
|
|
|
img.set_colorkey((0, 0, 0))
|
|
|
|
|
return img
|
|
|
|
|
|
2026-05-11 08:37:37 +00:00
|
|
|
|
|
|
|
|
def load_images(path: str) -> list[pygame.Surface]:
|
|
|
|
|
images: list[pygame.Surface] = []
|
2026-03-04 15:50:44 +00:00
|
|
|
for img_name in sorted(os.listdir(BASE_IMG_PATH + path)):
|
|
|
|
|
images.append(load_image(path + '/' + img_name))
|
2026-02-06 17:51:57 +00:00
|
|
|
return images
|