You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
977 B

6 months ago
from .. components import info
import pygame
class LoadScreen:
6 months ago
def start(self,game_info):
self.game_info = game_info
6 months ago
self.finished = False
self.next = 'level'
6 months ago
self.duration = 2000 # 持续时间
6 months ago
self.timer = 0
6 months ago
self.info = info.Info('load_screen',self.game_info)
6 months ago
def update(self,surface,keys):
self.draw(surface)
if self.timer == 0:
self.timer = pygame.time.get_ticks() # 如果初始时间为零改为当前时间
elif pygame.time.get_ticks() - self.timer > 2000:
self.finished = True
self.timer = 0
def draw(self,surface):
surface.fill((0,0,0))
6 months ago
self.info.draw(surface)
class GameOver(LoadScreen):
def start(self,game_info):
self.game_info = game_info
self.finished = False
self.next = 'main_menu'
self.duration = 4000
self.timer = 0
self.info = info.Info('game.over',self.game_info)