Archimonde666 / Challenge-drone-EA

GNU General Public License v3.0
0 stars 1 forks source link

Manual stop #13

Closed Archimonde666 closed 2 years ago

Archimonde666 commented 2 years ago

The actual stop with ESCAPE key isn't coded properly and thus does not work. Probable cause : the class run_status with only contain a value equal to RUN.STOP (boolean = False at start) isn't updated during keypress event

Archimonde666 commented 2 years ago

We should be able to fix it by creating an exception, it's not really "pleasant" but something like that would do the work :

try:
        loop.run_forever()
    except Exception:
        pass
    finally:
        pygame_task.cancel()
        animation_task.cancel()
        event_task.cancel()

    pygame.quit()
Archimonde666 commented 2 years ago

Appears to work finally