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);
 }
Exemple #2
0
 public Button(EventHandler onPressEvent, Text label)
 {
     this.onPressEvent = onPressEvent;
     this.label = label;
     this.label.SetColor(unfocusedColor);
     UpdatePosition();
 }
Exemple #3
0
 public void DrawText(Text text)
 {
     foreach (CharacterSprite c in text.CharacterSprites)
     {
         DrawSprite(c.Sprite);
     }
 }
        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");
        }
Exemple #5
0
 public Button(EventHandler onPressEvent, Text label)
 {
     _onPressEvent = onPressEvent;
     _label = label;
     _label.SetColor(new Color(0, 0, 0, 1));
     UpdatePosition();
 }
 /// <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);
 }
Exemple #7
0
 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();
 }
Exemple #8
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();
 }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        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 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();
        }
Exemple #15
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();
        }
        public KabajiEgara(PersistantGameData data, StateSystem system, Input input, Font generalFont, Font titleFont)
        {
            _gameData = data;
            _system = system;
            _input = input;
            _generalFont = generalFont;
            _titleFont = titleFont;

            _titleHelp = new Text("Kabaji Egara", _titleFont);
            //_blurbHelp = new Text("", _generalFont);
            _blurbHelp = new Text("COM-0513-10 2013", _generalFont);
            

            FormatText(_titleHelp, 300);
            FormatText(_blurbHelp, 200);
        }
        public CreditState(PersistantGameData data, StateSystem system, Input input, Font generalFont, Font titleFont)
        {
            _gameData = data;
            _system = system;
            _input = input;
            _generalFont = generalFont;
            _titleFont = titleFont;

            _titleHelp = new Text("How to Play", _titleFont);
            _blurbHelp = new Text("", _generalFont);
            _blurbHelp = new Text("Directional keys-move,Enter or X(gamepad) to fire", _generalFont);
            

            FormatText(_titleHelp, 300);
            FormatText(_blurbHelp, 200);
        }
        public void DrawText(Text text)
        {
            foreach (CharacterSprite c in text.CharacterSprites)
            {
                DrawSprite(c.Sprite);

               /* // Debug.
                Gl.glDisable(Gl.GL_TEXTURE_2D);

                Gl.glBegin(Gl.GL_TRIANGLES);
                foreach (var position in c.Sprite.VertexPositions)
                {
                    Gl.glVertex3d(position.X, position.Y, position.Z);
                }
                Gl.glEnd() ;
                Gl.glEnable(Gl.GL_TEXTURE_2D);*/
            }
        }
Exemple #19
0
        public GameOverState(PersistentGameData data, StateSystem system, Input input, Font generalFont, Font titleFont)
        {
            _gameData = data;
            _system = system;
            _input = input;
            _generalFont = generalFont;
            _titleFont = titleFont;

            _titleWin = new Text("Complete!", _titleFont);
            _blurbWin = new Text("Congratulations, you won!", _generalFont);
            _titleLose = new Text("Game Over!", _titleFont);
            _blurbLose = new Text("Please try again...", _generalFont);

            FormatText(_titleWin, 300);
            FormatText(_blurbWin, 200);

            FormatText(_titleLose, 300);
            FormatText(_blurbLose, 200);
        }
        public GameOverState(PersistentGameData data, StateSystem system, Input input, Font generalFont, Font titleFont)
        {
            _gameData = data;
            _system = system;
            _input = input;
            _generalFont = generalFont;
            _titleFont = titleFont;

            _titleWin = new Text("Completed this level!", _titleFont);
            _blurbWin = new Text("You defeated the invaders!", _generalFont);
            _titleLose = new Text("Game Over!", _titleFont);
            _blurbLose = new Text("Try again . ..", _generalFont);

            FormatText(_titleWin, 300);
            FormatText(_blurbWin, 200);

            FormatText(_titleLose, 300);
            FormatText(_blurbLose, 200);
        }
Exemple #21
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);
        }
 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();
 }
Exemple #23
0
 public void Add(string key, string value)
 {
     Text text = new Text(value, new Font(textureManager.Get("effects_font"), FontParser.Parse("effectsFont.fnt")));
     Effect effect = new Effect(text);
     effectsLibrary.Add(key, effect);
 }
Exemple #24
0
 public Effect(Text text)
 {
     this.text = text;
     Color = new Tween(1, 0, 0.5);
     Movement = new Tween(0, 25, 0.5);
 }
        private void FormatText(Text _text, int yPosition)
        {
            _text.SetPosition(-_text.Width / 2, yPosition);
            _text.SetColor(new Color(0, 0, 0, 1));

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