-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
26 lines (22 loc) · 673 Bytes
/
main.py
File metadata and controls
26 lines (22 loc) · 673 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
# main.py
import pygame
from menu_scene import MenuScene
from game_scene import GameScene
from settings import SCREEN_WIDTH, SCREEN_HEIGHT
def main():
pygame.init()
screen = pygame.display.set_mode(
(SCREEN_WIDTH, SCREEN_HEIGHT),
pygame.RESIZABLE
)
pygame.display.set_caption("Title goes here uwu")
while True:
# 1) Main menu screen
menu = MenuScene(screen)
chosen = menu.run() # returns string "chapter_name.yml"
# 2) Upon selection, enter GameScene
game = GameScene(screen, chosen)
game.run()
# When game.run() finishes, return to menu
if __name__ == "__main__":
main()