Exemplo n.º 1
0
        public GameOverState(Input input, StateSystem stateSystem, 
            GameData gameData, TextureManager textureManager)
        {
            this.input = input;
            this.stateSystem = stateSystem;
            this.gameData = gameData;
            this.textureManager = textureManager;

            scoreboard = new Scoreboard(gameData, textureManager);
            scoreboard.SetPosition(new Point(-scoreboard.Width / 2, 0));

            gameOverFont = new Font(textureManager.Get("title_font"), FontParser.Parse("titleFont.fnt"));
            gameOverText = new Text("Game Over", gameOverFont);
            gameOverText.SetPosition(-gameOverText.Width / 2, 100);

            returnFont = new Font(textureManager.Get("effects_font"), FontParser.Parse("effectsFont.fnt"));
            returnText = new Text("Press Enter to return to the start menu", returnFont);
            returnText.SetPosition(-returnText.Width / 2, -200);
        }
Exemplo n.º 2
0
        public Level(TextureManager textureManager, Input input, GameData gameData, EffectsManager effectsManager)
        {
            this.textureManager = textureManager;
            this.input = input;
            this.gameData = gameData;
            this.effectsManager = effectsManager;
            scoreboard = new Scoreboard(gameData, textureManager);

            // Initialize game data
            timeBetweenMoves = defaultSpeed;
            timer = timeBetweenMoves;
            lockTimer = lockSpeed;

            // Initialize boundaries
            InitBoundaries();

            // Initialize blocks
            InitGrid();
            minoManager = new TetrominoManager(this, textureManager, gameData);
            CreateMino();
            InitializeBoundingBlocks();
        }