This repository has been archived by the owner on May 29, 2021. It is now read-only.
forked from NoPriorCut/comp150-game
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.py
64 lines (48 loc) · 1.34 KB
/
Main.py
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import pygame
import sys
import FrameHandler
import Helper
import Menu
import Player
import MapGenerator
from Room import Room
pygame.init()
# variables
REFRESH_RATE = Helper.REFRESH_RATE
DISPLAY_SURFACE = Helper.DISPLAY_SURFACE
FPS_CLOCK = pygame.time.Clock()
pygame.display.set_caption('Sekai Saviour')
DISPLAY_SURFACE.fill((79, 51, 44))
player = Player.Player()
MapGenerator.run_separator()
game_state = 'Main_Menu'
prev_game_state = ''
is_paused = False
running = True
game_is_saved = False
first_room = Room()
second_room = Room()
while running:
while game_state == 'Main_Menu':
game_state, loaded_data = Menu.menu_update()
while game_state == 'Settings':
game_state = Menu.settings_menu_update()
while game_state == 'New_Game':
# event handling section
if loaded_data:
aux_player = loaded_data
print(aux_player.health)
player_action, game_state = FrameHandler.event_handler(
game_state,
player)
# action handling section
FrameHandler.update(player, player_action)
# display handling section
FrameHandler.renderer()
if game_state == 'Quit':
running = False
# cap fps
FPS_CLOCK.tick(REFRESH_RATE)
MapGenerator.run_remover() # cleans generated tiles from Resources/Tiles
pygame.quit()
sys.exit()