diff --git a/BlankProjectTemplate/src/Food.py b/BlankProjectTemplate/src/Food.py index ba839e1741113f4a854f442b398b0f35e1caa541..a59504b613ccd96fa4ed2464a0d10d07a2ad596e 100644 --- a/BlankProjectTemplate/src/Food.py +++ b/BlankProjectTemplate/src/Food.py @@ -19,7 +19,7 @@ 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, black1 , (location[0],location[1], self.size, self.size)) + pygame.draw.rect(win, [245,250,170] , (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 510eb2d21075b6f81dda24ba5a722738e33cbbe6..5de533a98f3edcd6387f55c2d29ad5d13a467466 100644 --- a/BlankProjectTemplate/src/Gameplay.py +++ b/BlankProjectTemplate/src/Gameplay.py @@ -151,7 +151,7 @@ def game(speed, colour, backgroundColour): ''' #Draw snake - snake.draw(snake_loc) + snake.draw(colour,snake_loc) #update display pygame.display.update() diff --git a/BlankProjectTemplate/src/Interface.py b/BlankProjectTemplate/src/Interface.py index caa87093284b6937099f9619495a0254d3263498..ea3896cadbdf6d3d85da3f0f03968eefb6300b55 100644 --- a/BlankProjectTemplate/src/Interface.py +++ b/BlankProjectTemplate/src/Interface.py @@ -50,7 +50,7 @@ def main(): pygame.display.set_caption("Lets Play") #Adding the play game button - if (400 <= mousepos[0] <= 400+170 and 250 <= mousepos[1] <= 300+50 ): + if (400 <= mousepos[0] <= 400+170 and 250 <= mousepos[1] <= 250+50 ): #checks if the mouse is hovering over the button GUI.button(game,darkgray, [400,250,170,50], 0) #checking if the button is clicked diff --git a/BlankProjectTemplate/src/Snake.py b/BlankProjectTemplate/src/Snake.py index 50ba320dcca2fc3086d39327408357da4439f117..740bdd8eeaebcbfabffe3777f39c6e5c5caa69e5 100644 --- a/BlankProjectTemplate/src/Snake.py +++ b/BlankProjectTemplate/src/Snake.py @@ -23,9 +23,9 @@ class Snake(): ## @brief Draw method uses pygame to draw the snake object # @param x The x-coordinate where the block should be drawn # @param y The y-coordinate where the block should be drawn - def draw(self,snake_loc): + def draw(self,colour, snake_loc): for x,y in snake_loc: - pygame.draw.rect(win, lightB , [x,y, self.size, self.size]) + pygame.draw.rect(win, colour , [x,y, self.size, self.size]) ## pygame.draw.circle(win, lightB , [x,y], int(self.size/2)) def die(): diff --git a/BlankProjectTemplate/src/__pycache__/Food.cpython-37.pyc b/BlankProjectTemplate/src/__pycache__/Food.cpython-37.pyc index 74b11249499f01e6fd3af8d5868fb1123ee7b2f3..c0b0ec68b2dcf7cd8fe4978a773785b8f9bb2ad6 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 95c0fdcd920453e7a22e9ecd712c4d9a867f1667..7738abd74ba29d78e4098be62efbcf5c8349bf75 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 1a4b892b56bd8ac8b8fbddb02594e7d7d2c7ddb9..04e4f48158ebdaed06f88c05f352a500a0d953b3 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 3dedbbe50f33ad4d08eb11ce411301ab4e49bd92..27ac104feaf801cdd76a49b4290c107dff507123 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 b54b7599ad8d9e8979d97adfde77edd319d5c62e..c2bd403646d552a0b509c6618f01dc7babd10065 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 62ac970de3e2e1265e1a2d428016c65026a0f51b..8a1120081f7f3dec20529945343639addb15cb9c 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 a53346a2afcf54be0ff1142c8e096f69f9f93434..dcd5b6f446ef514b7b7f77cb14449e3e9ecd1314 100644 Binary files a/BlankProjectTemplate/src/__pycache__/theme.cpython-37.pyc and b/BlankProjectTemplate/src/__pycache__/theme.cpython-37.pyc differ diff --git a/BlankProjectTemplate/src/init.py b/BlankProjectTemplate/src/init.py index 961cc09d341e9543309f0c3970bea09b42fd6159..72856f2a96e0d517e7ab81b2c2e1a61f63950ffb 100644 --- a/BlankProjectTemplate/src/init.py +++ b/BlankProjectTemplate/src/init.py @@ -10,7 +10,7 @@ from random import randint pygame.init() screenSize = 500 win = pygame.display.set_mode((screenSize,screenSize)) -pygame.display.set_caption("Snake 2.o") +pygame.display.set_caption("Snake") #Define color constants white = (255,255,255)