IEnumerator Start() { player = GameObject.Find("Player").GetComponent <Player>(); level = GameObject.Find("Level").GetComponent <LevelBehaviour>(); uiControl = GetComponent <UIControl>(); yield return(new WaitForEndOfFrame()); UpdateUI(); yield return(null); }
/// <summary> /// Sets up the <see cref="LevelGenerator"/> class and creates the first LevelBlocks. /// </summary> /// <param name='blockAmount'>The amount of blocks</param> /// <param name='blockLength'>The length of the blocks</param> /// <param name='levelBehavior'>The behaviour of the level</param> public Level(int blockAmount, int powerupOffset, float blockLength, ILevelBehaviour levelBehavior) { this.blockAmount = blockAmount; this.blockLength = blockLength; behaviour = levelBehavior; for (int i = 0; i < blockAmount; i++) { AddBlock(); AddDecoration(); if (i >= powerupOffset) { AddObstacles(); AddPowerUp(); } } levelBlockQueue.TrimToSize(); }
public GameFlow( IGameStateProvider gameStateProvider, IGameNotifications gameNotifications, IGameModeBehaviour gameModeBehaviour, IGameModeConfigurationProvider gameModeConfigurationProvider, IInputController inputController, IUiViewProvider uiViewProvider, ILevelSetup levelSetup, ILevelBehaviour levelBehaviour, IPlayerBehaviour playerBehaviour, IAddScore addScore) { _gameStateProvider = gameStateProvider; _gameNotifications = gameNotifications; _gameModeBehaviour = gameModeBehaviour; _gameModeConfigurationProvider = gameModeConfigurationProvider; _inputController = inputController; _uiViewProvider = uiViewProvider; _levelSetup = levelSetup; _levelBehaviour = levelBehaviour; _playerBehaviour = playerBehaviour; _addScore = addScore; }