-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
37 lines (25 loc) · 795 Bytes
/
main.py
File metadata and controls
37 lines (25 loc) · 795 Bytes
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
import pygame
import sys
from graphics.common import SCREEN_WIDTH, SCREEN_HEIGHT
from graphics.screens import ScreenManager, LoginScreen
pygame.init()
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
pygame.display.set_caption("Twirl")
def main():
clock = pygame.time.Clock()
screen_manager = ScreenManager()
screen_manager.set_screen(LoginScreen(screen_manager))
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
screen_manager.handle_event(event)
screen_manager.update()
screen_manager.draw(screen)
pygame.display.flip()
clock.tick(30)
pygame.quit()
sys.exit()
if __name__ == "__main__":
main()