more refactoring

master
David Raison 2014-08-31 00:02:36 +02:00
parent 2168d2376c
commit 84d431b81e
1 changed files with 5 additions and 5 deletions

10
game.py
View File

@ -20,7 +20,7 @@ class TheGame:
self.screen = pygame.display.set_mode(self.size) self.screen = pygame.display.set_mode(self.size)
self.colors = [BLUE, GREEN, RED, YELLOW] self.colors = [BLUE, GREEN, RED, YELLOW]
pygame.init() pygame.init()
self.font = pygame.font.Font(None, 60) self.big = pygame.font.Font(None, 90)
self.pinned = [] self.pinned = []
try: try:
pygame.mixer.init() pygame.mixer.init()
@ -33,7 +33,7 @@ class TheGame:
pygame.display.set_caption('Pin Avo, the Cado!') pygame.display.set_caption('Pin Avo, the Cado!')
def mute(self,mute=False,sound=True): def mute(self,mute=False, sound=True):
if not sound: if not sound:
return return
if mute: if mute:
@ -70,8 +70,8 @@ class TheGame:
def gameOver(self): def gameOver(self):
screen_width, screen_height = self.size screen_width, screen_height = self.size
gameOverImage = pygame.image.load("img/gameOver.png") gameOverImage = pygame.image.load("img/gameOver.png")
gameOverText = self.font.render('GAME OVER', 0, RED) gameOverText = self.big.render('GAME OVER', 0, YELLOW)
gameOverImage.blit(game_over, (screen_width/3, screen_height/2)) gameOverImage.blit(gameOverText, (screen_width/8, screen_height/6))
self.screen.blit(pygame.transform.scale(gameOverImage, self.size), (0, 0)) self.screen.blit(pygame.transform.scale(gameOverImage, self.size), (0, 0))
pygame.display.flip() pygame.display.flip()
pygame.time.wait(3000) pygame.time.wait(3000)
@ -130,7 +130,7 @@ class TheGame:
fullegast.blitme() fullegast.blitme()
if levelChange > 0: if levelChange > 0:
levelText = self.font.render('Level ' + str(level), 0, WHITE) levelText = self.big.render('Level ' + str(level), 0, WHITE)
screen.blit(levelText, (screen_width / 3, screen_height / 2)) screen.blit(levelText, (screen_width / 3, screen_height / 2))
levelChange -= 1 levelChange -= 1