public static void NewLevel() { // Increase the difficulty. Effects of the difficulty change are determined in each level's form Load event. difficulty++; // Open a random level levelIndex = rnd.Next(1, 3); myMenu.Hide(); switch (levelIndex) { // Survival case 1: HumphreyErik2424RST.frmSurvival Survival = new HumphreyErik2424RST.frmSurvival(); Survival.Show(); myMenu.Hide(); break; // Battle case 2: frmBattle Battle = new frmBattle(); Battle.Show(); myMenu.Hide(); break; /*** Unimplemented levels *** * // RPG * case 3: * frmRoleplayingGame RPG = new frmRoleplayingGame(); * RPG.Show(); * myMenu.Hide(); * break; * // Debugger (actually the name of a level for the end user to play) * case 4: * frmDebugger Debugger = new frmDebugger(); * Debugger.Show(); * myMenu.Hide(); * break; */ } }
public static void ResetAll() { if (_frmBattle != null) { _frmBattle.Close(); _frmBattle = null; } if (_frmMap != null) { _frmMap.Close(); _frmMap = null; } if (_frmGame != null) { _frmGame.Close(); _frmGame = null; } _isServer = false; _me = null; _server = null; _players.Clear(); _currentPlayer = null; _isNeedToStartGame = false; _isGameStarted = false; _isInitialized = false; _isAllPlayerInitialized = false; _needToRunNextPlayer = false; _isNeedToStartBattle = false; _amIBattle = false; _isBattleStarted = false; _attackPlayer = null; _attackHero = null; _attackArmies = null; _defendPlayer = null; _defendHero = null; _defendCastle = null; _defendArmies = null; _victory = 0; _isBattleEnded = false; _attackCommands.Clear(); _defendCommands.Clear(); }