public StartMenuState(Engine.Font titleFont, Engine.Font generalFont, Input input, StateSystem system, TextureManager textureManager) { _system = system; _generalFont = generalFont; _input = input; _textureManager = textureManager; _blockManager = new BlockManager(_textureManager, 0, 0, new Vector(1, 1, 1)); DropBlocks(); InitializeMenu(); _title = new Text("Subway Tetris", titleFont); _title.SetColor(new Color(0.85f, 0.85f, 0.10f, 1)); // Centerre on the x and place somewhere near the top _title.SetPosition(-_title.Width / 2, 300); }
public PlayingState(StateSystem system, TextureManager manager, Input input, Engine.Font infoFont, Vector playArea, Vector clientSize) { _system = system; _textureManager = manager; _input = input; _infoFont = infoFont; _playArea = playArea; _clientSize = clientSize; InitializeMenu(); _paused = false; _blockManager = new BlockManager(_textureManager, clientSize.X, clientSize.Y, new Vector(_scalingFactor, _scalingFactor, 0)); if (_scalingFactor < 1.0 && _scalingFactor > 0.5) { _playArea.X += _blockManager.BlockWidth * _scalingFactor; } _blockManager.SetBounds(-(_playArea.Y), _playArea.Y, -(_playArea.X), _playArea.X); _scoreText = new Text("Score: " + _blockManager.CompletedRows, _infoFont); _scoreText.SetPosition((clientSize.X / 2) - 250, 0); _scoreText.SetColor(new Color(0.19f, 0.8f, 0.19f, 1)); _pausedText = new Text("PAUSED", _infoFont); _pausedText.SetPosition(-_pausedText.Width/2, 250); _pausedText.SetColor(new Color(0.35f, 0.35f, 0.67f, 1)); GameStart(); }