void StartNewGame() { StopTitleScreenCoroutineIfAnyExists(); //other CurrentGameState = GameState.Playing; OnNewGameStarted?.Invoke(Time.time); }
/// <summary> /// Start game /// </summary> /// <param name="startingHeight">Starting height</param> /// <param name="startingLevel">Starting level</param> /// <param name="linesPerLevel">Lines per level</param> /// <param name="levelIncrement">Level increment</param> /// <param name="linesPerSpecial">Lines per special</param> /// <param name="specialsAdded">Specials added</param> /// <param name="specialCapacity">Special capacity</param> /// <param name="blockFrequencies">Block frequencies</param> /// <param name="specialFrequencies">Special frequencies</param> /// <param name="displayAverageLevel">Display average level</param> /// <param name="classicMode">Classic mode</param> /// <returns>Game manager</returns> public IGameManager StartGame(uint startingHeight, uint startingLevel, uint linesPerLevel, uint levelIncrement, uint linesPerSpecial, uint specialsAdded, uint specialCapacity, IReadOnlyList <EBlock> blockFrequencies, IReadOnlyList <ESpecial> specialFrequencies, bool displayAverageLevel, bool classicMode) { if (gameManager == null) { gameManager = new GameManager(user, new GameOptions(startingHeight, startingLevel, linesPerLevel, levelIncrement, linesPerSpecial, specialsAdded, specialCapacity, blockFrequencies, specialFrequencies, displayAverageLevel, classicMode)); OnNewGameStarted?.Invoke(gameManager); } return(gameManager); }
/// <summary> /// New game started event /// </summary> /// <param name="startingHeight">Starting height</param> /// <param name="startingLevel">Starting level</param> /// <param name="linesPerLevel">Lines per level</param> /// <param name="levelIncrement">Level increment</param> /// <param name="linesPerSpecial">Lines per special</param> /// <param name="specialsAdded">Specials added</param> /// <param name="specialCapacity">Special capacity</param> /// <param name="blockFrequencies">Block frequencies</param> /// <param name="specialFrequencies">Special frequencies</param> /// <param name="displayAverageLevels">Display average levels</param> /// <param name="classicMode">Classic mode</param> private void NewGameStartedEvent(uint startingHeight, uint startingLevel, uint linesPerLevel, uint levelIncrement, uint linesPerSpecial, uint specialsAdded, uint specialCapacity, IReadOnlyList <EBlock> blockFrequencies, IReadOnlyList <ESpecial> specialFrequencies, bool displayAverageLevels, bool classicMode) { if (gameManager != null) { OnEndGame?.Invoke(); } gameManager = new GameManager(user, new GameOptions(startingHeight, startingLevel, linesPerLevel, levelIncrement, linesPerSpecial, specialsAdded, specialCapacity, blockFrequencies, specialFrequencies, displayAverageLevels, classicMode)); IsGameInProgress = true; OnNewGameStarted?.Invoke(gameManager); }