diff --git a/BlankProjectTemplate/src/Food.py b/BlankProjectTemplate/src/Food.py index aaed1139a10cbd97c62a03987dd0c5fea7bcf892..ba839e1741113f4a854f442b398b0f35e1caa541 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, blue , (location[0],location[1], self.size, self.size)) + pygame.draw.rect(win, black1 , (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/Snake.py b/BlankProjectTemplate/src/Snake.py index bc419c43a6107a08ca0ce8d4c47121ff20c446ed..50ba320dcca2fc3086d39327408357da4439f117 100644 --- a/BlankProjectTemplate/src/Snake.py +++ b/BlankProjectTemplate/src/Snake.py @@ -25,7 +25,8 @@ class Snake(): # @param y The y-coordinate where the block should be drawn def draw(self,snake_loc): for x,y in snake_loc: - pygame.draw.rect(win, red , [x,y, self.size, self.size]) + pygame.draw.rect(win, lightB , [x,y, self.size, self.size]) +## pygame.draw.circle(win, lightB , [x,y], int(self.size/2)) def die(): #---------------------INSERT CODE ----------------- diff --git a/BlankProjectTemplate/src/init.py b/BlankProjectTemplate/src/init.py index 88ba0d68750492cdb68776a28837810e691e5e17..961cc09d341e9543309f0c3970bea09b42fd6159 100644 --- a/BlankProjectTemplate/src/init.py +++ b/BlankProjectTemplate/src/init.py @@ -15,6 +15,9 @@ pygame.display.set_caption("Snake 2.o") #Define color constants white = (255,255,255) red = (255,0,0) +lightB = (89,131,146) +black1 = (1,22,30) +white_green = (239,246,224) blue = (0,0,255) black = (0,0,0) diff --git a/BlankProjectTemplate/src/snake_image.png b/BlankProjectTemplate/src/snake_image.png deleted file mode 100644 index cf3f0abe920c8a70740cb103d1b0fa767f0f4a12..0000000000000000000000000000000000000000 Binary files a/BlankProjectTemplate/src/snake_image.png and /dev/null differ diff --git a/BlankProjectTemplate/src/theme.py b/BlankProjectTemplate/src/theme.py index 78e1964503a5b6b4a677f016652985ed033b096d..1785b717b96f2357dd74c342fd38211e91954288 100644 --- a/BlankProjectTemplate/src/theme.py +++ b/BlankProjectTemplate/src/theme.py @@ -1,6 +1,7 @@ import pygame, sys from random import randint import Gameplay +import init class Themes(): @@ -34,34 +35,39 @@ class Themes(): surface.blit(text,coord) def themes(speed): + lightBlue = (89,131,146) + black1 = (1,22,30) + white_green = (239,246,224) + white = (255,255,255) + pygame.init() run = True while run: theme = pygame.display.set_mode((500, 500)) - theme.fill([200, 150, 250]) + theme.fill(white_green) mousepos = pygame.mouse.get_pos() #checking mouse position mouseclick = pygame.mouse.get_pressed()#checking mouse pressed pygame.display.set_caption("Choose Theme") - Themes.text('Choose Your Theme',"times",45,[96,96,96],(70,50),theme) + Themes.text('Choose Your Theme',"maiandragd",45,[96,96,96],(70,50),theme) - Themes.button(theme,[200,200,200], [75,150,150,100], 0) - Themes.text('Regular',"comicsansms", 40,[200, 0, 0],(80,170),theme) + Themes.button(theme,lightBlue, [75,150,150,100], 0) + Themes.text('Regular',"maiandragd", 40,white_green,(80,170),theme) if (75 <= mousepos[0] <= 75+150 and 150 <= mousepos[1] <= 150+100 ): if mouseclick[0] == 1: Gameplay.game(speed,[255,0,0],[255,255,255]) - Themes.button(theme,[0,0,0], [280,150,150,100], 0) - Themes.text('Dark',"comicsansms", 40,[225,255,255],(305,170),theme) + Themes.button(theme,black1, [280,150,150,100], 0) + Themes.text('Dark',"maiandragd", 40,white,(305,170),theme) if (280 <= mousepos[0] <= 280+150 and 150 <= mousepos[1] <= 150+100 ): if mouseclick[0] == 1: - Gameplay.game(speed,[255,255,255],[10,10,10]) + Gameplay.game(speed,white,[10,10,10]) - Themes.button(theme,[0,0,0], [175,300,80,50], 0) + Themes.button(theme,lightBlue, [175,300,80,50], 0) Themes.button(theme,[200,200,200], [175,350,80,50], 0) Themes.button(theme,[200,200,200], [255,300,80,50], 0) Themes.button(theme,[0,0,0], [255,350,80,50], 0) - Themes.text('Ramdom',"comicsansms", 40,[150,0,0],(180,315),theme) + Themes.text('Random',"maiandragd", 40,[150,0,0],(180,315),theme) if (180 <= mousepos[0] <= 180+160 and 315 <= mousepos[1] <= 315+100 ): if mouseclick[0] == 1: x = randint(0, 1)