import pygame
pygame.init()
import math
running = True
windowHeight = 500
windowWidth = 500
window = pygame.display.set_mode((windowHeight, windowWidth))
clock = pygame.time.Clock()
score = 0
smiley = pygame.image.load("smiley.png")
smiley = pygame.transform.scale(smiley,(120,120))
font = pygame.font.Font('Extra Blue.ttf', 26)
stillCirclePos = [250,250]
stillCircleSize = 60
stillCircleColour = (0,0,0)
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if event.type == pygame.MOUSEBUTTONDOWN:
print(mousePos)
if distance < stillCircleSize:
score += 1
print(score)
mousePos = pygame.mouse.get_pos()
window.fill((255,255,255))
#print(mousePos)
distance = math.sqrt( ((mousePos[0]-stillCirclePos[0])**2)+((mousePos[1]-stillCirclePos[1])**2))
scoreDisplay = "Points:", score
renderedText = font.render(scoreDisplay, 1, pygame.Color("red"))
window.blit(renderedText, (50,50))
pygame.draw.circle(window, stillCircleColour, stillCirclePos, stillCircleSize)
window.blit(smiley, (190,190))
pygame.display.flip()
clock.tick(60)
pygame.quit
Whenever I try to run this code, it says “TypeError: text must be a unicode or bytes”. How do I prevent this from happening, while making the text display the score?