def get_startkeys(window): ### gets key presses from start window global START pygame.init() key = pygame.key.get_pressed() if key[pygame.K_s]: START = True elif key[pygame.K_q]: pygame.quit() elif key[pygame.K_a]: text_to_gamer(about_game, (200, 500), window, black, 40) pass
def start_window(): start_screen = pygame.display.set_mode((screen_width, screen_height)) start_screen.fill(light_salmon) text_to_gamer('START : press S', (300, 100), start_screen, black, 40) text_to_gamer('EXIT : press Q', (300, 200), start_screen, red, 40) text_to_gamer(about_game, (0, 500), start_screen, black, 13) text_to_gamer(about_dev, (0, 600), start_screen, midnightblue, 12) update_screen() get_exit() get_startkeys(start_screen) pass
def paused_game_screen(window): pygame.init() info_pos_x = 100 update_screen() window.fill(orangered) get_events_paused() text_to_gamer('GAME PAUSED', (info_pos_x, 30), window, midnightblue, 60) text_to_gamer('RESUME: press ESC', (info_pos_x, 500), window, black, 30) text_to_gamer('EXIT : press Q', (info_pos_x, 560), window, black, 30)
def score_manager(window): ## LEVEL text_to_gamer(f'LEVEL : {LEVEL}', (screen_width - 400, screen_height - 30), window, green, 20) ## SCORE text_to_gamer(f'HIGHSCORE : {backend.get_highscore(highscore_file)}', (screen_width - 200, screen_height - 30), window, blue, 20) text_to_gamer(f'LIVES : {LIVES}', (screen_width - 600, screen_height - 30), window, red, 20)
def smashed_screen(window): global GAME_OVER ### when you get hit if GAME_OVER == True: # window = pygame.display.set_mode((screen_width - 200 , screen_height)) window.fill(white) text_to_gamer('GAME OVER', (screen_width / 3, 100), window, orangered, 70) text_to_gamer(f'LEVEL : {LEVEL}', (screen_width / 3, 200), window, black, 60) text_to_gamer('restarting........', (screen_width / 3, 400), window, yellow, 40) pygame.display.update() update_screen()