diff --git a/BlankProjectTemplate/src/Gameplay.py b/BlankProjectTemplate/src/Gameplay.py index 26896d83b37acf5a81088f640b45cc9f626da5d4..a25950879083bf0a13e816242f896f201d508034 100644 --- a/BlankProjectTemplate/src/Gameplay.py +++ b/BlankProjectTemplate/src/Gameplay.py @@ -9,6 +9,7 @@ from Food import * import ScoreDisplay def game(speed, colour,food_colour, backgroundColour): + pygame.event.clear() x = randint(0, grid_length) * size y = randint(0, grid_length) * size #defining a list to update snanke's length @@ -97,8 +98,9 @@ def game(speed, colour,food_colour, backgroundColour): y > screenSize - size or x > screenSize - size): + run = False ScoreDisplay.display(score,speed, colour,food_colour, backgroundColour) - + #-------------------------------------------------