所以我有這個(gè)錯(cuò)誤 pygame.error: font not initialized 我已經(jīng)厭倦了通過(guò)縮進(jìn)它來(lái)修復(fù)它,未識(shí)別它,更改字體和其他東西但它仍然無(wú)法在我的 STARTMENUE 上工作。我也嘗試過(guò)使用另一種字體,認(rèn)為這是問(wèn)題所在,但事實(shí)并非如此。我有問(wèn)題嗎largeText = pygame.font.Font('freesansblod.ttf',115)我的完整代碼import pygame#set screenwindow = pygame.display.set_mode((500,500))#set Namepygame.display.set_caption("Noob")class Player: def __init__(self,x,y,height,width,color): self.x = x self.y = y self.height = height self.color = color self.speed = 0 self.isJump = False self.JumpCount = 10 self.fall = 0 self.rect = pygame.Rect(x,y,height,width) def draw(self): self.topleft = (self.x,self.y)class Floor: def __init__ (self,x,y,height,width,color): self.x = x self.y = y self.height = height self.width = width self.color = color self.rect = pygame.Rect(x,y,height,width) def draw(self): self.topleft = (self.x,self.y) pygame.draw.rect(window,self.color,self.rect)class Coin(): def __init__(self,x,y,height,width,color): self.x = x self.y = y self.width = width self.height = height self.color = color self.rect = pygame.Rect(x,y,height,width) def draw(self): self.topleft = (self.x,self.y) self.draw.rect(self.color,self.rect) white = (255,255,255)green = (0,200,0)red = (255,0,0)drakred = (200,0,0)darkgreen = (0,200,0)black = (0,0,0) player1 = Player(50,400,40,40,white)coin = Coin(100,300,30,30,red)floor1 = Floor(0,400,600,30,green)fps = (30)clock = pygame.time.Clock()
添加回答
舉報(bào)
0/150
提交
取消