cleaned code

This commit is contained in:
Moris Krajnc 2020-07-16 10:58:01 +02:00
parent 37ab165bfc
commit be9838af5c

View File

@ -282,10 +282,6 @@ hs3_time = 300000
# initialise the game
pygame.init()
#fps counter definitions
#font = pygame.font.Font('freesansbold.ttf', 30)
#clock = pygame.time.Clock()
# screen settings - autodetermined based on the initialised pygame video instance
screen_size_x = pygame.display.Info().current_w
screen_size_y = pygame.display.Info().current_h
@ -299,6 +295,7 @@ logoff_sound = pygame.mixer.Sound('snd/winxplogoff.wav')
pygame_font_1 = pygame.font.Font('freesansbold.ttf', 90)
pygame_font_2 = pygame.font.Font('freesansbold.ttf', 65)
pygame_font_3 = pygame.font.Font('freesansbold.ttf', 45)
pygame_font_4 = pygame.font.Font('freesansbold.ttf', 16)
# colors
pygame_color_green = pygame.Color(42, 217, 13)
@ -786,11 +783,6 @@ while True:
time_rectangle = time_surface.get_rect()
time_rectangle.topleft = (640, 480)
# fps = font.render(str(int(clock.get_fps())), True, pygame.Color('white'))
# screen.blit(fps, (50, 50))
# pygame.display.flip()
# clock.tick(30)
errors_surface = pygame_font_2.render('Fehler: ' + str(errors), True, pygame_font_main_color)
errors_rectangle = errors_surface.get_rect()
errors_rectangle.topleft = (640, 560)
@ -802,8 +794,9 @@ while True:
screen.blit(time_surface, time_rectangle) #time
screen.blit(header_surface, header_rectangle) #header
# display everything
#pygame.display.flip()
fps = pygame_font_4.render(str(int(pygame_clock.get_fps())), True, pygame.Color('white'))
screen.blit(fps, (50, 50))
# if another push of start is detected (i.e. the game is ending!)
if not GPIO.input(pin_stop):