-
Notifications
You must be signed in to change notification settings - Fork 0
/
Settings.py
37 lines (31 loc) · 1.08 KB
/
Settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import pygame
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode([1200,700])
def settingsMenu():
background = pygame.image.load("SettingsScreen.png")
backgroundrec = background.get_rect()
while True:
screen.blit(background, backgroundrec)
pygame.display.update()
for event in pygame.event.get():
if event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE):
return
if event.type == MOUSEBUTTONDOWN:
location = pygame.mouse.get_pos()
if location[1] > 270 and location[1] < 586:
if location[0] > 91 and location[0] < 305:
settingsFile = open("settings.txt", "wb")
settingsFile.write("Background.png")
settingsFile.close()
return
if location[0] > 493 and location[0] < 707:
settingsFile = open("settings.txt", "wb")
settingsFile.write("RainbowBackground.png")
settingsFile.close()
return
if location[0] > 894 and location[0] < 1103:
settingsFile = open("settings.txt", "wb")
settingsFile.write("StarryBackground.png")
settingsFile.close()
return