diff --git a/cowyeet.py b/cowyeet.py index df502ef..1900e17 100644 --- a/cowyeet.py +++ b/cowyeet.py @@ -279,16 +279,23 @@ def get_events(): elif event.type == pygame.KEYDOWN: key = event.key - if key == pygame.K_SPACE: + if key == pygame.K_c and pressed_special_keys & pygame.KMOD_CTRL: + close() + + elif key == pygame.K_SPACE: if page == "ingame": yeet_cow() def loop(): global last_frame_mouse_pressed + global pressed_keys + global pressed_special_keys screen.fill(nero) + pressed_keys = keyboard.get_pressed() + pressed_special_keys = keyboard.get_mods() get_events() if not running: @@ -325,11 +332,14 @@ cow_flying = False cow_position = (0, 0) cow_flight_path = [] cow_flight_step = 0 +pressed_keys = [] +pressed_special_keys = pygame.key.get_mods() # pygame objects clock = pygame.time.Clock() # misc mouse = pygame.mouse +keyboard = pygame.key bigger_default_font = pygame.font.SysFont("ubuntu", 32) # fonts