-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (26 loc) · 819 Bytes
/
main.py
File metadata and controls
31 lines (26 loc) · 819 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
import sys
import pygame
from space_game import game as space_game
from setup_menu import start_setup
import space_game.game_config as config
import flappy_bird.game as flappy
import pdf.show as pdf
def close_setup_window():
pygame.display.quit()
pygame.quit()
def main(mode):
pygame.init()
size = (config.WINDOW_WIDTH, config.WINDOW_HEIGHT)
screen = pygame.display.set_mode(size)
pygame.display.set_caption(config.WINDOW_CAPTION)
start_setup(screen)
if mode == 'space':
space_game.start_game(screen)
elif mode == 'flappy':
close_setup_window()
flappy.start_game('flappy_bird\\flappy_bird.exe')
elif mode == 'reader':
close_setup_window()
pdf.start_pdf_reader('pdf\War_and_Peace.pdf')
if __name__ == '__main__':
main(sys.argv[1])