Merge branch 'master' of github.com:lvl2/avocados
commit
3c5172f08c
11
game.py
11
game.py
|
@ -27,6 +27,8 @@ class TheGame:
|
||||||
self.screen = pygame.display.set_mode((self.WIDTH, self.HEIGHT))
|
self.screen = pygame.display.set_mode((self.WIDTH, self.HEIGHT))
|
||||||
self.colors = [BLUE, GREEN, RED, YELLOW]
|
self.colors = [BLUE, GREEN, RED, YELLOW]
|
||||||
self.bg = pygame.image.load(os.path.join('img', 'lawyerCrystalBall.png'))
|
self.bg = pygame.image.load(os.path.join('img', 'lawyerCrystalBall.png'))
|
||||||
|
self.bg.set_colorkey((255,255,255))
|
||||||
|
self.bg.set_alpha(75)
|
||||||
|
|
||||||
# fonts
|
# fonts
|
||||||
self.bigFont = pygame.font.Font(None, 90)
|
self.bigFont = pygame.font.Font(None, 90)
|
||||||
|
@ -268,12 +270,21 @@ class TheGame:
|
||||||
else:
|
else:
|
||||||
score -= 50
|
score -= 50
|
||||||
|
|
||||||
|
|
||||||
# Had enough of this?
|
# Had enough of this?
|
||||||
if event.type == pygame.QUIT:
|
if event.type == pygame.QUIT:
|
||||||
running = False
|
running = False
|
||||||
game.gameOver()
|
game.gameOver()
|
||||||
pygame.quit()
|
pygame.quit()
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
elif event.type == pygame.KEYDOWN:
|
||||||
|
if pygame.key.get_pressed()[pygame.K_f] != 0:
|
||||||
|
print("Toggling full screen, in the Future")
|
||||||
|
elif (pygame.key.get_pressed()[pygame.K_q] != 0) or (pygame.key.get_pressed()[pygame.K_ESCAPE] != 0):
|
||||||
|
running = False
|
||||||
|
game.gameOver()
|
||||||
|
pygame.quit()
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
pygame.display.flip()
|
pygame.display.flip()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue