-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame.py
76 lines (60 loc) · 2.1 KB
/
Game.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
65
66
67
68
69
70
71
72
73
74
75
76
from ursina import *
import GameConfiguration
from Rules import Rules
from Overlays.NotificationsManager import NotificationManager
from Overlays.Notification import Notification
from GameStates import GameStates
from Online.Presence.Presence import GamePresence
from Content.ContentManager import ContentManager
from GPSystem.GPmain import GPSystem
from Changelog import *
from Audio.AudioSystem import AudioSystem
from Statistics import Statistics
from utils.ExceptionHandler import ExceptionHandler
from ScoreManager import ScoreManager
from Screens.ScreenManager import ScreenManager
state = GameStates.intro
presence = GamePresence() if not GameConfiguration.local_dev_branch else None
rating_program = GPSystem()
state_affected = False
version = "Super Dooper Beta"
user = None
changelog = Changelog()
content_manager = ContentManager()
notification_manager = NotificationManager()
audio_system = AudioSystem(GameConfiguration.music_volume, GameConfiguration.sound_volume)
selected_area = None
testing_screen = None
exception_handler = ExceptionHandler(notification_manager)
rules = Rules()
score_manager = ScoreManager()
stats = Statistics()
language = content_manager.get_language(GameConfiguration.language)
app = None
screen_manager = None
def migrate_stats_to_user():
global user
global stats
if user:
user.get_stats().converge(stats)
stats = Statistics()
def change_state(new_state: GameStates):
global state
global state_affected
if presence:
presence.update_status(f"Currently in {new_state.name}")
state = new_state
state_affected = False
def reload_screen():
global notification_manager
global screen_manager
notification_manager.add_notification(Notification(language.reloading_screen, color.yellow))
screen_manager.kill()
screen_manager = ScreenManager(app)
invoke(lambda: change_state(GameStates.mainMenu), delay=GameConfiguration.fade_time * 2)
def testing():
return state == GameStates.testing
# changelog
game = ChangeCategory("game")
game.add_change(Change("actually made the game lol", "GDcheerios"))
changelog.add_category(game)