-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
24 lines (20 loc) · 987 Bytes
/
main.py
File metadata and controls
24 lines (20 loc) · 987 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
import pygame
from scenes.login import LoginScene
import utils
from scenes import WelcomeScene, BooksScene, PrepareScene, RememberScene, GameScene
_screen_size = (1280, 1024)
if __name__ == "__main__":
pygame.init()
screen = pygame.display.set_mode(_screen_size)
pygame.display.set_caption("兔哥背单词")
utils.SceneManager.AddScene("Welcome", WelcomeScene(_screen_size), True)
utils.SceneManager.AddScene("Login", LoginScene(_screen_size, "login", theme_path="themes.json"))
utils.SceneManager.AddScene("Books", BooksScene(_screen_size, "books", theme_path="themes.json"))
utils.SceneManager.AddScene("Prepare", PrepareScene(_screen_size))
utils.SceneManager.AddScene("Remember", RememberScene(_screen_size))
utils.SceneManager.AddScene("Game", GameScene(_screen_size))
clock = pygame.time.Clock()
while utils.SceneManager.Update():
utils.SceneManager.Draw(screen)
clock.tick(60)
pygame.quit()