From 23d46a24b35e186f480c7b2f6f824d0a4f648757 Mon Sep 17 00:00:00 2001 From: <vc2310@LAPTOP-FCB0H0KM.localdomain> Date: Mon, 19 Nov 2018 23:37:44 -0500 Subject: [PATCH] adding one more theme --- BlankProjectTemplate/src/theme.py | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/BlankProjectTemplate/src/theme.py b/BlankProjectTemplate/src/theme.py index e445905..fd12595 100644 --- a/BlankProjectTemplate/src/theme.py +++ b/BlankProjectTemplate/src/theme.py @@ -1,4 +1,5 @@ import pygame, sys +from random import randint class Themes(): @@ -35,25 +36,37 @@ class Themes(): pygame.init() run = True while run: - theme = pygame.display.set_mode((450, 300)) + theme = pygame.display.set_mode((500, 500)) theme.fill([200, 150, 250]) 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],(50,50),theme) + Themes.text('Choose Your Theme',"times",45,[96,96,96],(70,50),theme) - Themes.button(theme,[200,200,200], [50,150,150,100], 0) - Themes.text('Regular',"comicsansms", 40,[200, 0, 0],(55,170),theme) - if (50 <= mousepos[0] <= 50+150 and 150 <= mousepos[1] <= 150+100 ): + Themes.button(theme,[200,200,200], [75,150,150,100], 0) + Themes.text('Regular',"comicsansms", 40,[200, 0, 0],(80,170),theme) + if (75 <= mousepos[0] <= 75+150 and 150 <= mousepos[1] <= 150+100 ): if mouseclick[0] == 1: Themes.runfile('Gameplay.py') - Themes.button(theme,[0,0,0], [250,150,150,100], 0) - Themes.text('Dark',"comicsansms", 40,[255,255,255],(275,170),theme) - if (250 <= mousepos[0] <= 250+150 and 150 <= mousepos[1] <= 150+100 ): + Themes.button(theme,[0,0,0], [280,150,150,100], 0) + Themes.text('Dark',"comicsansms", 40,[225,255,255],(305,170),theme) + if (280 <= mousepos[0] <= 280+150 and 150 <= mousepos[1] <= 150+100 ): if mouseclick[0] == 1: Themes.runfile('Gameplay.py') + + Themes.button(theme,[0,0,0], [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) + if (180 <= mousepos[0] <= 180+160 and 315 <= mousepos[1] <= 315+100 ): + if mouseclick[0] == 1: + x = randint(0, 1) + if(x == 1): Themes.runfile('Gameplay.py') + else: Themes.runfile('Gameplay.py') pygame.display.update() - + +Themes.themes() -- GitLab