changed the way the game ends
This commit is contained in:
		
							
								
								
									
										35
									
								
								gametest.py
									
									
									
									
									
								
							
							
						
						
									
										35
									
								
								gametest.py
									
									
									
									
									
								
							| @@ -165,28 +165,27 @@ while True: # main loop | |||||||
|                 #if GPIO.input(startPin) == False: |                 #if GPIO.input(startPin) == False: | ||||||
|                 #        justStarted = False |                 #        justStarted = False | ||||||
|                 #if GPIO.input(startPin) == True and justStarted == False: |                 #if GPIO.input(startPin) == True and justStarted == False: | ||||||
|                 if GPIO.input(startPin) == True: |                 if GPIO.input(startPin) != True: | ||||||
|                         #break |  | ||||||
|                         continue #skip the rest |  | ||||||
|  |  | ||||||
|                 clearScreen() |                         clearScreen() | ||||||
|                 header_surface = font.render('Game over!', True, mainFontColor) |                         header_surface = font.render('Game over!', True, mainFontColor) | ||||||
|  |  | ||||||
|                 screen.blit(errors_surface, errors_rectangle) #errors |                         screen.blit(errors_surface, errors_rectangle) #errors | ||||||
|                 screen.blit(time_surface, time_rectangle) #time  |                         screen.blit(time_surface, time_rectangle) #time  | ||||||
|                 screen.blit(header_surface, header_rectangle) #header |                         screen.blit(header_surface, header_rectangle) #header | ||||||
|  |  | ||||||
|                 pygame.display.flip() |                         pygame.display.flip() | ||||||
|  |  | ||||||
|                 #while GPIO.input(startPin) == False: |                         #while GPIO.input(startPin) == False: | ||||||
|                 #        handle_events() |                         #        handle_events() | ||||||
|  |  | ||||||
|                 #while GPIO.input(startPin) == True: |                         #while GPIO.input(startPin) == True: | ||||||
|                 #        handle_events() |                         #        handle_events() | ||||||
|  |  | ||||||
|                 #while GPIO.input(startPin) == False: |                         #while GPIO.input(startPin) == False: | ||||||
|                 #        handle_events() |                         #        handle_events() | ||||||
|  |  | ||||||
|  |                         clearScreen() | ||||||
|  |                         time.sleep(10) | ||||||
|  |                         break | ||||||
|  |  | ||||||
|                 clearScreen() |  | ||||||
|                 time.sleep(10) |  | ||||||
|                 break |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user