Exemple #1
0
 public Scoreboard(GameData gameData, TextureManager textureManager)
 {
     this.gameData = gameData;
     font = new Font(textureManager.Get("effects_font"), FontParser.Parse("effectsFont.fnt"));
     level = new Text("Level: " + gameData.Level.ToString(), font);
     score = new Text("Score : " + gameData.Score.ToString(), font);
     position = new Point((float)Block.WIDTH * 7, -30);
     UpdateWidth();
 }
Exemple #2
0
        public TetrominoManager(Level level, TextureManager textureManager, GameData gameData)
        {
            this.level = level;
            this.textureManager = textureManager;
            this.gameData = gameData;

            holdArea = new HoldArea(level, this, textureManager);
            positionChanged = false;
            minoQueue = new MinoQueue(this, level, textureManager);
        }
Exemple #3
0
        public InnerGameState(Input input, StateSystem stateSystem, TextureManager textureManager,
            GameData gameData, EffectsManager effectsManager)
        {
            this.input = input;
            this.stateSystem = stateSystem;
            this.textureManager = textureManager;
            this.gameData = gameData;
            this.effectsManager = effectsManager;

            OnGameStart();
        }
Exemple #4
0
        public StartMenuState(StateSystem stateSystem, TextureManager textureManager, 
            Input input, GameData gameData)
        {
            this.input = input;
            this.textureManager = textureManager;
            this.stateSystem = stateSystem;
            this.gameData = gameData;

            // Create title
            titleFont = new Font(textureManager.Get("title_font"), FontParser.Parse("titleFont.fnt"));
            titleText = new Text("bTris", titleFont);
            titleText.SetPosition(-titleText.Width / 2, 150);
            titleText.SetColor(new Color(1, 1, 1, 1));

            InitializeMenu();
        }
Exemple #5
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);
        }
Exemple #6
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();
        }