1 Star 0 Fork 1

tpig / pygame-tetris

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
resource_manager.py 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
tpig 提交于 2020-12-07 23:41 . ..
import pygame
from blocktype import BlockType
class ResManager:
def __init__(self):
self.image_dict = {}
self.load_images()
self.board_bg = pygame.image.load("img/starsky.png")
def load_images(self):
"""
"L": "blue.png",
"S": "red.png",
"Z": "yellow.png",
"J": "purple.png",
"I": "cyan.png",
"T": "green.png",
"O": "red.png",
"""
self.image_dict["L"] = \
pygame.image.load("img/" + BlockType.images.get("L"))
self.image_dict["S"] = \
pygame.image.load("img/" + BlockType.images.get("S"))
self.image_dict["Z"] = \
pygame.image.load("img/" + BlockType.images.get("Z"))
self.image_dict["J"] = \
pygame.image.load("img/" + BlockType.images.get("J"))
self.image_dict["I"] = \
pygame.image.load("img/" + BlockType.images.get("I"))
self.image_dict["T"] = \
pygame.image.load("img/" + BlockType.images.get("T"))
self.image_dict["O"] = \
pygame.image.load("img/" + BlockType.images.get("O"))
Python
1
https://gitee.com/tpig/pygame-tetris.git
git@gitee.com:tpig/pygame-tetris.git
tpig
pygame-tetris
pygame-tetris
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891