python - AttributeError: 'Event' object has no attribute 'key ...
stackoverflow.com › questions › 57432382Aug 09, 2019 · Traceback (most recent call last): File "C:/Users/user/PycharmProjects/MyDevWork/PygamesRelated/game_1.py", line 29, in <module> elif event.key == pygame.K_s: AttributeError: 'Event' object has no attribute 'key'. import pygame pygame.init () screen = pygame.display.set_mode ( (720, 480)) clock = pygame.time.Clock () FPS = 60 BLACK = (0, 0, 0) WHITE = (255, 255, 255) rect = pygame.Rect ( (0, 0), (32, 32)) image = pygame.Surface ( (32, 32)) image.fill (WHITE) while True: clock.tick (FPS) ...