# Path: game/splash.py
# class SplashScreen(GameState):
#     def __init__(self):
#         self.alpha_percent = 0.0
#         self.group_list    = (DIAMOND,)
#         self.logo          = HudObject(LOGO, [0, 0])
#         self.start_time    = 5 * 60  #In frames
#         
#         BOOT.play()
#         self.logo.rect.center = config.SCREEN_RECT.center
#         self.logo.image.set_alpha(0)
#         DIAMOND.add(self.logo)
#         
#     def __del__(self):
#         BOOT.stop()
#         super().__del__()
#         
#     def events(self, events):
#         for e in events:
#         #For all input events received...
#             if e.type in {KEYDOWN, MOUSEBUTTONDOWN}:
#             #If the user presses any button...
#                 self.change_state(MainMenu)
#         
#     def logic(self):
#         self.start_time    -= 1
#         self.alpha_percent += 1
#         self.logo.image.set_alpha(self.alpha_percent)
#         if not self.start_time:
#         #Once the logo's finished fading in...
#             self.change_state(MainMenu)
#     
#     def render(self):
#         screen.fill(color.WHITE)
#         
#         for i in self.group_list:
#             i.draw(screen)
# 
#         display.flip()
#         assert not config.show_fps()
#         #^ So this statement is stripped in Release mode.
# 
#         config.fps_timer.tick_busy_loop(60 * _limit_frame)


import pygame.event
from game.splash import SplashScreen
'''
This module manages the game loop; it handles the flow from one game state (aka
game screen) to the next.

@var _current_state: The screen we're currently at.
'''


### Globals ####################################################################

# Path: game/splash.py
# class SplashScreen(GameState):
#     def __init__(self):
#         self.alpha_percent = 0.0
#         self.group_list    = (DIAMOND,)
#         self.logo          = HudObject(LOGO, [0, 0])
#         self.start_time    = 5 * 60  #In frames
#         
#         BOOT.play()
#         self.logo.rect.center = config.SCREEN_RECT.center
#         self.logo.image.set_alpha(0)
#         DIAMOND.add(self.logo)
#         
#     def __del__(self):
#         BOOT.stop()
#         super().__del__()
#         
#     def events(self, events):
#         for e in events:
#         #For all input events received...
#             if e.type in {KEYDOWN, MOUSEBUTTONDOWN}:
#             #If the user presses any button...
#                 self.change_state(MainMenu)
#         
#     def logic(self):
#         self.start_time    -= 1
#         self.alpha_percent += 1
#         self.logo.image.set_alpha(self.alpha_percent)
#         if not self.start_time:
#         #Once the logo's finished fading in...
#             self.change_state(MainMenu)
#     
#     def render(self):
#         screen.fill(color.WHITE)
#         
#         for i in self.group_list:
#             i.draw(screen)
# 
#         display.flip()
#         assert not config.show_fps()
#         #^ So this statement is stripped in Release mode.
# 
#         config.fps_timer.tick_busy_loop(60 * _limit_frame)


# Path: core/gsm.py
import pygame.event
from game.splash import SplashScreen

'''
This module manages the game loop; it handles the flow from one game state (aka
game screen) to the next.

@var _current_state: The screen we're currently at.
'''


### Globals ####################################################################

_current_state = SplashScreen()