-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
49 lines (36 loc) · 1.23 KB
/
main.py
File metadata and controls
49 lines (36 loc) · 1.23 KB
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
40
41
42
43
44
45
46
47
48
49
import pygame
from menu import*
from phases import earth_moon
from surface import age_moon
from theia import theia_moon
if getattr(sys, 'assets', False):
os.chdir(sys._MEIPASS)
# Define constants for the screen width and height
SCREEN_WIDTH = 1040
SCREEN_HEIGHT = 720
def main():
pygame.init()
pygame.font.init()
pygame.display.set_caption("Origins of the Moon")
screen = pygame.display.set_mode((SCREEN_WIDTH , SCREEN_HEIGHT))
game_state = GameState.TITLE
current_level = 0
while True:
if game_state == GameState.TITLE:
game_state = title_screen(screen)
if game_state == GameState.NEWGAME:
game_state = play_level(screen)
if game_state == GameState.FORMATION_LEVEL:
current_level += 1
game_state = theia_moon(screen)
if game_state == GameState.EARTHMOON_LEVEL:
current_level += 1
game_state = earth_moon(screen)
if game_state == GameState.MOONAGE_LEVEL:
current_level += 1
game_state = age_moon(screen)
if game_state == GameState.QUIT:
pygame.quit()
return
if __name__ == "__main__":
main()