Aug-21-2019, 03:24 PM
import pygame, sys class Scene: def __init__(self): self.team1 = 0 self.team2 = 0 self.font = pygame.font.SysFont('Cosmic Sans MS', 900) self.team1txt = self.font.render(str(self.team1), True, (24, 14, 89,)) self.team2txt = self.font.render(str(self.team2), True, (31, 200, 32,)) self.scoreboard = pygame.image.load("scoreboard.jpg") def draw(self, screen): screen.blit(self.scoreboard, (0, 0)) screen.blit(self.team1txt, (500, 500)) class main: def __init__(self, winx, winy, caption): self.screen = pygame.display.set_mode((winx, winy)) self.caption = pygame.display.set_caption(caption) self.clock = pygame.time.Clock() self.scene = Scene() self.black = (200, 0, 0) def loop(self): self.notDead = True while self.notDead: for event in pygame.event.get(): if event.type == pygame.QUIT: self.notDead = False if event.type == pygame.KEYDOWN: if event.key == pygame.K_LEFT: self.scene.team1 += 1 print(str(self.scene.team1)) if event.key == pygame.K_RIGHT: self.scene.team2 += 1 print(str(self.scene.team2)) self.scene.draw(self.screen) pygame.display.update() self.clock.tick(60) if __name__ == '__main__': pygame.init() pygame.font.init() game = main(1920, 1080, 'Scoreboard') game.loop()I can't seem to get the team1 and team2 score to show on the display. Any help is appreciated :)