From 7eb0e813d4bca9b6dbc193b1e3a74cee109d8409 Mon Sep 17 00:00:00 2001 From: Steve Clement Date: Sun, 31 Aug 2014 10:44:46 +0200 Subject: [PATCH] - Added Alpha channel to lawyer pic, added q/esc to exit --- game.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/game.py b/game.py index 9ca2342..bc74a04 100755 --- a/game.py +++ b/game.py @@ -31,6 +31,8 @@ class TheGame: self.screen = pygame.display.set_mode(self.size) self.colors = [BLUE, GREEN, RED, YELLOW] self.bg = pygame.image.load(os.path.join('img', 'lawyerCrystalBall.png')) + self.bg.set_colorkey((255,255,255)) + self.bg.set_alpha(75) # fonts self.bigFont = pygame.font.Font(None, 90) @@ -234,12 +236,21 @@ class TheGame: elif hit == False: score -= 50 + # Had enough of this? if event.type == pygame.QUIT: running = False game.gameOver() pygame.quit() 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()