Added name in corner

This commit is contained in:
2025-07-16 15:21:37 +01:00
parent bd3a986699
commit 1bd3ebe2f6

View File

@ -73,6 +73,7 @@ class Game(gameUtils.Game):
self.gunScale = min(self.size[1]/self.gunh,self.size[0]/self.gunw) #calculates how to scale the gun so that it stays on the screen self.gunScale = min(self.size[1]/self.gunh,self.size[0]/self.gunw) #calculates how to scale the gun so that it stays on the screen
self.font = pygame.font.SysFont('', 64)
#Selects random music to play at the start of the game, might change because I just threw this together. #Selects random music to play at the start of the game, might change because I just threw this together.
#I feel horrible writing this code this feels super unoptimised :c #I feel horrible writing this code this feels super unoptimised :c
@ -156,6 +157,7 @@ class Game(gameUtils.Game):
#screen code #screen code
self.surf.fill("black") self.surf.fill("black")
self.surf.blit(gameUtils.centre(pygame.transform.scale_by(self.gun.getFrame(), self.gunScale), self.size)) self.surf.blit(gameUtils.centre(pygame.transform.scale_by(self.gun.getFrame(), self.gunScale), self.size))
self.surf.blit(self.font.render(f'Current player: {self.currentlyPlaying.name}', True, (255, 255, 255)), (0, 0))
def close(self): def close(self):
""" """