From ba8ac4447157c03c26db7b1089bfce6004c288ec Mon Sep 17 00:00:00 2001 From: <vc2310@LAPTOP-FCB0H0KM.localdomain> Date: Sun, 28 Oct 2018 01:32:21 -0400 Subject: [PATCH] updating code --- BlankProjectTemplate/src/Snake_Game.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/BlankProjectTemplate/src/Snake_Game.py b/BlankProjectTemplate/src/Snake_Game.py index 471c02c..fbc084e 100644 --- a/BlankProjectTemplate/src/Snake_Game.py +++ b/BlankProjectTemplate/src/Snake_Game.py @@ -49,17 +49,17 @@ while True: game.blit(SpeedOption,(50,400)) #If user wants to quit - pygame.draw.rect(game,[180,180,180], [650,550,130,55], 0) - Quit = playgame_font.render('QUIT', True, (0, 0, 0)) - game.blit(Quit,(650,550)) if ( 650 <= mousepos[0] <= 650+130 and 550 <= mousepos[1] <= 550 +55): #checks if the mouse is hovering over the button - #checking if the button is clicked - if mouseclick[0] == 1: - #print ("quiting") - #pygame.display.quit() + pygame.draw.rect(game,[200,0,0],[650,550,130,55], 0) + #checking if the button is clicked + if mouseclick[0] == 1: pygame.quit() sys.exit() + else: + pygame.draw.rect(game,[180,180,180], [650,550,130,55], 0) + Quit = playgame_font.render('QUIT', True, (0, 0, 0)) + game.blit(Quit,(650,550)) pygame.display.update() -- GitLab