Ninja-Jump-and-run/scripts/utils.py
2026-02-06 18:51:57 +01:00

15 lines
No EOL
379 B
Python

import pygame
import os
BASE_IMG_PATH = 'data/images/'
def load_image(path):
image = pygame.image.load(BASE_IMG_PATH + path).convert()
image.set_colorkey((0,0,0))
return image
def load_images(path):
images = []
bilder = os.listdir(BASE_IMG_PATH + path)
for image in bilder:
images.append(load_image(path +"/" + image))
return images