Skip to content
Snippets Groups Projects
Commit d301e3ae authored by Hameed Andy's avatar Hameed Andy
Browse files

Interface theme changed

parent 9d705541
No related branches found
No related tags found
No related merge requests found
BlankProjectTemplate/src/Exit_image.png

5.31 KiB

...@@ -98,10 +98,6 @@ def game(speed, colour,food_colour, backgroundColour): ...@@ -98,10 +98,6 @@ def game(speed, colour,food_colour, backgroundColour):
x > screenSize - size): x > screenSize - size):
ScoreDisplay.display(score,speed, colour,food_colour, backgroundColour) ScoreDisplay.display(score,speed, colour,food_colour, backgroundColour)
#pygame.quit() #for now, quit the game when snake hits boundary
## snake.die()
#------------------------------------------------- #-------------------------------------------------
...@@ -125,7 +121,7 @@ def game(speed, colour,food_colour, backgroundColour): ...@@ -125,7 +121,7 @@ def game(speed, colour,food_colour, backgroundColour):
win.blit(text,(0,0)) win.blit(text,(0,0))
if ([x,y] in snake_loc) and snake_length > 1: if ([x,y] in snake_loc) and snake_length > 1:
pygame.time.delay(1000) ## pygame.time.delay(1000)
# pygame.quit() #quit for now, but should return to main menu # pygame.quit() #quit for now, but should return to main menu
ScoreDisplay.display(score,speed, colour,food_colour, backgroundColour) ScoreDisplay.display(score,speed, colour,food_colour, backgroundColour)
......
...@@ -17,40 +17,48 @@ def storeScore(score): ...@@ -17,40 +17,48 @@ def storeScore(score):
def display(score,speed, colour,food_colour, backgroundColour): def display(score,speed, colour,food_colour, backgroundColour):
pygame.init() pygame.init()
storeScore(score) storeScore(score)
lightBlue = [89,131,145]
darkgray = [100,100,100]
white = [255,255,255]
image1 = pygame.image.load("Exit_image.png")
run = True run = True
while run: while run:
mousepos = pygame.mouse.get_pos() #checking mouse position mousepos = pygame.mouse.get_pos() #checking mouse position
mouseclick = pygame.mouse.get_pressed()#checking mouse pressed mouseclick = pygame.mouse.get_pressed()#checking mouse pressed
lastPage = pygame.display.set_mode((500, 500)) lastPage = pygame.display.set_mode((500, 500))
lastPage.fill([200,150,100]) lastPage.blit(image1,(0,0))
## lastPage.fill()
highscore.HighScore.text('WOAHH Your Score is ' + str(score),"comicsansms", 35,[0, 200, 200],(40,50),lastPage) highscore.HighScore.text('Your Highscore is ' + str(score),"maiandragd", 35,[0, 0, 0],(70,50),lastPage)
if (150 <= mousepos[0] <= 150+200 and 150 <= mousepos[1] <= 150+60 ): if (150 <= mousepos[0] <= 150+200 and 150 <= mousepos[1] <= 150+60 ):
highscore.HighScore.button(lastPage,[0,255,0], [150,150,200,60], 0) highscore.HighScore.button(lastPage,darkgray, [150,150,200,60], 0)
if mouseclick[0] == 1: if mouseclick[0] == 1:
Gameplay.game(speed, colour,food_colour, backgroundColour) Gameplay.game(speed, colour,food_colour, backgroundColour)
else: else:
highscore.HighScore.button(lastPage,[0,170,0], [150,150,200,60], 0) highscore.HighScore.button(lastPage,lightBlue, [150,150,200,60], 0)
highscore.HighScore.text('PLAY AGAIN',"comicsansms", 30,[0,0,0],(160,160),lastPage) highscore.HighScore.text('Play Again',"maiandragd", 25, white,(193,165),lastPage)
if (150 <= mousepos[0] <= 150+200 and 260 <= mousepos[1] <= 260+60 ): if (150 <= mousepos[0] <= 150+200 and 260 <= mousepos[1] <= 260+60 ):
highscore.HighScore.button(lastPage,[0,0,255], [150,260,200,60], 0) highscore.HighScore.button(lastPage,darkgray, [150,260,200,60], 0)
if mouseclick[0] == 1: if mouseclick[0] == 1:
Interface.main() Interface.main()
else: else:
highscore.HighScore.button(lastPage,[0,0,170], [150,260,200,60], 0) highscore.HighScore.button(lastPage,lightBlue, [150,260,200,60], 0)
highscore.HighScore.text('MAIN MENU',"comicsansms", 30,[0,0,0],(160,270),lastPage) highscore.HighScore.text('Main Menu',"maiandragd", 25,white,(189,275),lastPage)
if (150 <= mousepos[0] <= 150+200 and 370 <= mousepos[1] <= 370+60 ): if (150 <= mousepos[0] <= 150+200 and 370 <= mousepos[1] <= 370+60 ):
highscore.HighScore.button(lastPage,[250,0,0], [150,370,200,60], 0) highscore.HighScore.button(lastPage,darkgray, [150,370,200,60], 0)
if mouseclick[0] == 1: if mouseclick[0] == 1:
pygame.quit() pygame.quit()
sys.exit() sys.exit()
else: else:
highscore.HighScore.button(lastPage,[170,0,0], [150,370,200,60], 0) highscore.HighScore.button(lastPage,lightBlue, [150,370,200,60], 0)
highscore.HighScore.text('CAN\'T PLAY',"comicsansms", 30,[0,0,0],(160,380),lastPage) highscore.HighScore.text('Quit',"maiandragd", 25,white,(225,385),lastPage)
pygame.display.update() pygame.display.update()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment