林做一個遊戲來練習mygame和IM創造高分屏,但我似乎無法正確的blit文我多麼希望在pygame的位圖傳輸文本
這裏是高分方法
def high_screen(self):
screen.blit(background,(0,0))
myfont = pygame.font.SysFont("impact", 20)
scorefile = open('highscores.txt', 'r')
highscores = scorefile.read()
label = myfont.render((highscores), 1, (0,0,0))
screen.blit(label, (0, 0))
self.back = pygame.image.load('resources/screen/back.png')
self.back_r = self.back.get_bounding_rect()
self.back_r.x,self.back_r.y = (100,600)
screen.blit(self.back,(100, 600))
screen.blit(self.player,(self.mouse_pos))
if self.player_r.colliderect(self.back_r)and pygame.mouse.get_pressed()[0]:
self.state = 1
這ggets從一個.txt文件的高分和blits他們,但它在一條線上blits他們,當我想要每個分數傳遞大約從上面的100個像素
所以我怎麼能使它分裂文本從文件和blits每個分數下降100個像素?
謝謝
-Christian Careaga
這就是真實的,但我想我要像10分,但我不希望有10個文件 – Serial
好吧我不是在Python數據存儲太棒了,我認爲你可以使用擱置,而不是10個文件只有10個鍵。 –
有趣....虐待嘗試 – Serial