diff --git a/BlankProjectTemplate/src/Food.py b/BlankProjectTemplate/src/Food.py index 50c734edb1a5b15cf4b8b3005a3911cbe1e1d8a1..a642ca9033f3f40ebfe9ea9e18914b16560dd07d 100644 --- a/BlankProjectTemplate/src/Food.py +++ b/BlankProjectTemplate/src/Food.py @@ -18,8 +18,8 @@ class Food(): ## @brief Draw method uses pygame to draw the food object on the window # @param location A list which consists the x and y location of the food - def draw_food(self, location): - pygame.draw.rect(win, [245,250,170] , (location[0],location[1], self.size, self.size)) + def draw_food(self, food_colour, location): + pygame.draw.rect(win, food_colour , (location[0],location[1], self.size, self.size)) ## @brief redraw_food method redraws the food on the screen randomly # @param x is the location of snake's x-axis head location diff --git a/BlankProjectTemplate/src/Gameplay.py b/BlankProjectTemplate/src/Gameplay.py index 5de533a98f3edcd6387f55c2d29ad5d13a467466..3ef365efa71c43109372d7509cd280e04464898e 100644 --- a/BlankProjectTemplate/src/Gameplay.py +++ b/BlankProjectTemplate/src/Gameplay.py @@ -7,7 +7,7 @@ from random import randint from Snake import * from Food import * -def game(speed, colour, backgroundColour): +def game(speed, colour,food_colour, backgroundColour): x = randint(0, grid_length) * size y = randint(0, grid_length) * size #defining a list to update snanke's length @@ -137,7 +137,7 @@ def game(speed, colour, backgroundColour): snake_blocks = len(snake_loc) #Draw food item - food.draw_food(food_location) + food.draw_food(food_colour, food_location) if snake_blocks > snake_length: diff --git a/BlankProjectTemplate/src/__pycache__/Food.cpython-37.pyc b/BlankProjectTemplate/src/__pycache__/Food.cpython-37.pyc index c0b0ec68b2dcf7cd8fe4978a773785b8f9bb2ad6..fa2123b29d79ff150dc102688744d0a62d3461e4 100644 Binary files a/BlankProjectTemplate/src/__pycache__/Food.cpython-37.pyc and b/BlankProjectTemplate/src/__pycache__/Food.cpython-37.pyc differ diff --git a/BlankProjectTemplate/src/__pycache__/Gameplay.cpython-37.pyc b/BlankProjectTemplate/src/__pycache__/Gameplay.cpython-37.pyc index 7738abd74ba29d78e4098be62efbcf5c8349bf75..334480d3b3ab6b61d9176893fdc21bbc64603e10 100644 Binary files a/BlankProjectTemplate/src/__pycache__/Gameplay.cpython-37.pyc and b/BlankProjectTemplate/src/__pycache__/Gameplay.cpython-37.pyc differ diff --git a/BlankProjectTemplate/src/__pycache__/Interface.cpython-37.pyc b/BlankProjectTemplate/src/__pycache__/Interface.cpython-37.pyc index 04e4f48158ebdaed06f88c05f352a500a0d953b3..b4486b601870dd96aab93d9a5bc948caeb117a04 100644 Binary files a/BlankProjectTemplate/src/__pycache__/Interface.cpython-37.pyc and b/BlankProjectTemplate/src/__pycache__/Interface.cpython-37.pyc differ diff --git a/BlankProjectTemplate/src/__pycache__/Snake.cpython-37.pyc b/BlankProjectTemplate/src/__pycache__/Snake.cpython-37.pyc index 27ac104feaf801cdd76a49b4290c107dff507123..a45d2c5b189b3f5a551175338cb9f563831f4cff 100644 Binary files a/BlankProjectTemplate/src/__pycache__/Snake.cpython-37.pyc and b/BlankProjectTemplate/src/__pycache__/Snake.cpython-37.pyc differ diff --git a/BlankProjectTemplate/src/__pycache__/highscore.cpython-37.pyc b/BlankProjectTemplate/src/__pycache__/highscore.cpython-37.pyc index c2bd403646d552a0b509c6618f01dc7babd10065..b54b7599ad8d9e8979d97adfde77edd319d5c62e 100644 Binary files a/BlankProjectTemplate/src/__pycache__/highscore.cpython-37.pyc and b/BlankProjectTemplate/src/__pycache__/highscore.cpython-37.pyc differ diff --git a/BlankProjectTemplate/src/__pycache__/init.cpython-37.pyc b/BlankProjectTemplate/src/__pycache__/init.cpython-37.pyc index 8a1120081f7f3dec20529945343639addb15cb9c..d460e4e19a6f03caa21bb80935a5042c790416ba 100644 Binary files a/BlankProjectTemplate/src/__pycache__/init.cpython-37.pyc and b/BlankProjectTemplate/src/__pycache__/init.cpython-37.pyc differ diff --git a/BlankProjectTemplate/src/__pycache__/theme.cpython-37.pyc b/BlankProjectTemplate/src/__pycache__/theme.cpython-37.pyc index dcd5b6f446ef514b7b7f77cb14449e3e9ecd1314..a53346a2afcf54be0ff1142c8e096f69f9f93434 100644 Binary files a/BlankProjectTemplate/src/__pycache__/theme.cpython-37.pyc and b/BlankProjectTemplate/src/__pycache__/theme.cpython-37.pyc differ