-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
39 lines (31 loc) · 1.11 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
import pygame
from pygame.locals import *
from src.colors import color
from src.menu import Menu
from src.start import Start as st
from src.ordination import Ordination as odt
screen_size = (660, 420)
screen = pygame.display.set_mode(screen_size)
pygame.display.set_caption('AlgoData')
# this is to control all the pages of thes aplication
links = {"start": st(), "menu": Menu(), "ordination_algorithms": odt()}
current_layout = "ordination_algorithms"
# current_layout = "start"
theme = True
keep_going = True
# Clock
clock = pygame.time.Clock()
while keep_going:
for event in pygame.event.get():
if event.type == pygame.QUIT:
exit()
elif event.type == pygame.KEYDOWN:
if pygame.key.get_pressed()[pygame.K_KP_ENTER]:
exit()
elif pygame.key.get_pressed()[pygame.K_t]:
theme = not theme
clock.tick(30)
# Working on theme change later
screen.fill(color.black.value) if theme else screen.fill(color.white1.value)
current_layout = links[current_layout].run(screen, screen_size)
pygame.display.update()