Skip to content
Snippets Groups Projects
Commit e45c4227 authored by Hameed Andy's avatar Hameed Andy
Browse files
parents 5d1e76fa 23d46a24
No related branches found
No related tags found
No related merge requests found
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()
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