I am trying to create a small game. I made a score tracker with font.Font .
points = 0
score_text = pygame.font.Font('Pixeltype.ttf',100)
score_surf = score_text.render(f'Current points: {points}', None, 'Green')
This is before the while True loop that starts the game. This is pure variable declaration.
Later below, as i defeat 'enemies', I add +100 points to points.
Although my score does not update with screen.blit(score_surf,(850,40))
, if i call print(points)
, my points have indeed increased.
I tried creating a separate text element for the points, still had this problem.
I am new to pygame module and i figured out I should practice the stuff i learned before moving on.
Thanks a lot in advance!