def __init__(self):
pygame.init()
pygame.key.set_repeat(250,25)
self.width = cell_size*(2*cols+2)
self.height = cell_size*rows
self.rlim = cell_size*cols
self.default_font = pygame.font.Font(
pygame.font.get_default_font(), 12)
self.screen = pygame.display.set_mode((self.width, self.height))
pygame.event.set_blocked(pygame.MOUSEMOTION) # We do not need
# mouse movement
# events, so we
# block them.
self.next_stone = tetris_shapes[rand(len(tetris_shapes))]
self.init_game()
pygame.mixer.init()
pygame.mixer.music.load(file)
pygame.mixer.music.play(loops=-1)
评论列表
文章目录