Ninja-Jump-and-run/scripts/utils.py

15 lines
379 B
Python
Raw Normal View History

2026-02-06 17:51:57 +00:00
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