コード例 #1
0
        public SplashScreenState(StateSystem system, TextureManager textureManager, Engine.Font titleFont, SoundManager soundManager)
        {
            _system = system;

            //sound
            _soundManager = soundManager;
            _soundManager.MasterVolume(0.01f);

            //title font
            _title = new Text("Immune Cells vs. Invaders", titleFont);
            _title.SetColor(new Color(0, 0, 0, 1));
            _title.SetPosition(-_title.Width / 2, 300);

            // good guys
            _character1.Texture = textureManager.Get("phagocyte");
            _character1.SetScale(2, 2);
            _character1.SetPosition(-150, 100);

            //bad guys
            _invader1.Texture = textureManager.Get("tatoo_dye");
            _invader1.SetScale(2, 2);
            _invader1.SetPosition(200, 100);

            _invader2.Texture = textureManager.Get("parasite");
            _invader2.SetScale(2, 2);
            _invader2.SetPosition(200, 0);

               // _soundManager.PlaySound("intro_music");
        }
コード例 #2
0
 /// <summary>
 /// This is a slow but often convient function.
 /// </summary>
 /// <param name="text"></param>
 /// <param name="font"></param>
 public void DrawText(double x, double y, string text, Font font)
 {
     Text textObj = new Text(text, font);
     textObj.SetColor(new Color(0,0,0,1));
     textObj.SetPosition(x, y);
     DrawText(textObj);
 }
コード例 #3
0
 public StartMenuState(Engine.Font titleFont)
 {
     _title = new Text("Shooter", titleFont);
     _title.SetColor(new Color(0, 0, 0, 1));
     // Centerre on the x and place somewhere near the top
     _title.SetPosition(-_title.Width / 2, 300);
 }
コード例 #4
0
ファイル: Scoreboard.cs プロジェクト: beamery/bTris
 public void Update()
 {
     level = new Text("Level: " + gameData.Level.ToString(), font);
     score = new Text("Score : " + gameData.Score.ToString(), font);
     level.SetPosition(position.X, position.Y);
     score.SetPosition(position.X, position.Y - 30);
     UpdateWidth();
 }
コード例 #5
0
        public StartMenuState(Engine.Font titleFont, Engine.Font generalFont, Input input, StateSystem system)
        {
            _system = system;

            _generalFont = generalFont;
            _input = input;
            InitializeMenu();
            _title = new Text("Shooter", titleFont);
            _title.SetColor(new Color(0, 0, 0, 1));
            // Centerre on the x and place somewhere near the top
            _title.SetPosition(-_title.Width / 2, 300);
        }
コード例 #6
0
        public PauseGameState(Engine.Font titleFont, Engine.Font generalFont, Input input, StateSystem system)
        {
            _input = input;
            _system = system;
            _generalFont = generalFont;
            InitializeMenu();
            _title = new Text("Pause", titleFont);
            _title.SetColor(new Color(0, 0, 0, 1));

            // Center on x and move toward the top
            _title.SetPosition(-_title.Width / 2, 300);
        }
コード例 #7
0
        public StartMenuState(Font titleFont, Font generalFont, Input input, StateSystem system)
        {
            _input = input;
            _system = system;
            _generalFont = generalFont;
            InitializeMenu();
            _title = new Text("Another Castle", titleFont);
            _title.SetColor(new Color(0, 0, 0, 1));

            // Center on x and move toward the top
            _title.SetPosition(-_title.Width/2, 300);
        }
コード例 #8
0
        public StartMenuState(Engine.Font titleFont, Engine.Font generalFont, Input input, StateSystem system)
        {
            _system = system;
            _input = input;
            _generalFont = generalFont;
            InitializeMenu();

            _title = new Text("Immunity vs. Invaders", titleFont);
            _title.SetColor(new Color(0, 0, 0, 1));

            _title.SetPosition(-_title.Width / 2, 300);
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        public InnerGameState(StateSystem system, Input input, TextureManager textureManager, PersistentGameData gameData, Font generalFont)
        {
            _input = input;
            _system = system;
            _gameData = gameData;
            _generalFont = generalFont;
            _textureManager = textureManager;

            _bloodStream = new Text("BloodStream", generalFont);
            _bloodStream.SetColor(new Color(0, 0, 0, 1));

            _bloodStream.SetPosition(-600, 0);

            OnGameStart();
        }
コード例 #11
0
ファイル: StartMenuState.cs プロジェクト: beamery/bTris
        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();
        }
コード例 #12
0
ファイル: GameOverState.cs プロジェクト: beamery/bTris
        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);
        }
コード例 #13
0
 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();
 }
コード例 #14
0
        private void FormatText(Text _text, int yPosition)
        {
            _text.SetPosition(-_text.Width / 2, yPosition);
            _text.SetColor(new Color(0, 0, 0, 1));

        }
コード例 #15
0
 private static void FormatText(Text text, int yPosition)
 {
     text.SetPosition(-text.Width/2, yPosition);
     text.SetColor(new Color(0, 0, 0, 1));
 }