-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMain.py
72 lines (52 loc) · 1.96 KB
/
Main.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Standard
import time
# Related
from HotKeys import *
from Abstract import *
from Guide import *
# Local
import pygame
from pygame.locals import *
windowSize = pygame.display.set_mode((800, 600), pygame.RESIZABLE) # Window default size
pygame.display.set_caption('Blume') # Title of window
pygame.init() # Init point
clock = pygame.time.Clock() # Create an object to help track time
run = True # Game is running constantly
keyDown = [[], [], []] # Arrays of cordinats
windowSize.fill((0, 0, 0)) # Fill function which fills the Surface object with black color
abstractLogo = Abstract()
hotKeys = HotKeys()
guide = Guide()
abstractLogo.random()
abstractLogo.draw(pygame=pygame, screen=windowSize)
def main():
guide.guide()
rainbow = 0 # Default value of rainbow colors moving real time
while run:
for event in pygame.event.get():
hotKeys.quit(action=event)
#hotKeys.mouseButtons(action=event)
if event.type == pygame.KEYDOWN:
keyDown[0].append(hotKeys.actionKeys(action=event))
# Without this two line zooming doesn't work
keyDown[1].append(event.key)
keyDown[2] = keyDown[0][-1:]
hotKeys.changeImage(actionKeys=keyDown, screen=windowSize, logo=abstractLogo, rainbow=rainbow)
hotKeys.saveImage(actionKeys=keyDown, screen=windowSize)
hotKeys.saveObjectShape(actionKeys=keyDown, logo=abstractLogo)
hotKeys.openSavedObjectShape(actionKeys=keyDown, logo=abstractLogo, screen=windowSize)
hotKeys.zoomInzoomOut(actionKeys=keyDown, screen=windowSize, logo=abstractLogo)
rainbow = hotKeys.contrastColorsChanging(rainbow=rainbow, actionKeys=keyDown, logo=abstractLogo, screen=windowSize)
try:
if event.type == pygame.KEYUP:
del keyDown[0][keyDown[1].index(event.key)]
del keyDown[1][keyDown[1].index(event.key)]
except:
pass
if rainbow:
abstractLogo.draw(pygame, screen=windowSize, play=1)
clock.tick(250)
pygame.display.flip()
pygame.quit()
if __name__ == "__main__":
main()