1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
import pygame from math import floor texture_map = pygame.image.load('./assets/textures/intro_atlas.png') preloaded = [] for i in range(8): for j in range(8): preloaded.append(texture_map.subsurface((360 * j, 360 * i, 360, 360))) def draw_texture(id): return preloaded[id] def unload_intro(): global texture_map del texture_map