def __init__(self): Base.clearTime() # 重置游戏计时 self.clock = pygame.time.Clock() self.fullScreen = Con.FullScreen # noinspection PyTypeChecker self.manager: Controller.LocalManager = None self.frame = Base.MyFrame() self.running = False self.caption = f'Escape_Rect Version:{Con.Version}' self.enemy_num = 1 self.Font = None
def __init__(self, targetScreen: Base.MyFrame = None): self._target = targetScreen or Base.MyFrame() self.playerHandler = PlayerHandler(self) self.enemyHandler = EnemyHandler(self) self.originEnemyNum = 0 self.originPlayerList: Dict[int, str] = {} self.state = self.STATE_FIRST self.alive = True self.lastIncreaseTime = Base.getTimeMil() self.process = 0 self.processIncrease = 0 self.endProcess = 0 self.font = Base.getFont(Con.Font, int(self.target.get_size()[0] / Con.FontRelation))