while my flappy bird is much bigger than this, here is the code that you need to understand the problem
class Game:
def __init__(self):
self.font = pygame.font.Font('flappy bird/graphics/font/BD_Cartoon_Shout.ttf',30)
self.score = 0
def Display_Score(self):
self.score = pygame.time.get_ticks()
font_surface = self.font.render(f'{self.score}', True, 'black')
when I run this code, pygame.error: Passed a NULL pointer appears, and I don’t know how to fix this.
I tried to change self.score to be just a regular string
font_surface = self.font.render('sample text', True, 'black')
and the same error showed up, is it an issue with my device because I also tried deleting and reinstalling pygame?
New contributor
Krishav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.