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");
        }
 public SetupStatePathCreation(Input input, StateSystem system, PathData pathData)
 {
     Gl.glEnable(Gl.GL_BLEND);
     Gl.glBlendFunc(Gl.GL_SRC_ALPHA, Gl.GL_ONE_MINUS_SRC_ALPHA);
     _input = input;
     _system = system;
     _pathData = pathData;
 }
Пример #3
0
 public InnerGameState(StateSystem system, Input input, PersistantGameData gameData, Font generalFont)
 {
     _input = input;
     _system = system;
     _gameData = gameData;
     _generalFont = generalFont;
     OnGameStart();
 }
Пример #4
0
 public InnerGameState(StateSystem system, Input input, TextureManager textureManager,
     PersistentGameData gameData)
 {
     _system = system;
     _input = input;
     _textureManager = textureManager;
     _gameData = gameData;
     OnGameStart();
 }
Пример #5
0
 public InnerGameState(StateSystem system, Input input, TextureManager textureManager,
                         PersistantGameData gameData, Font generalFont)
 {
     _textureManager = textureManager;
     _input = input;
     _system = system;
     _gameData = gameData;
     _generalFont = generalFont;
     OnGameStart();
 }
Пример #6
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();
        }
Пример #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 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);
        }
Пример #10
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);
        }
Пример #11
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);
        }
Пример #12
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();
        }
Пример #13
0
        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);
        }
Пример #14
0
        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);
        }
Пример #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();
        }
Пример #16
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("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);
        }
Пример #17
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);
        }
Пример #18
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);
        }
Пример #19
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();
 }
 public ConvexPolyDrawerState(Input input, PathFinder pathFinder, StateSystem system)
 {
     _input = input;
     _stateSystem = system;
     _pathFinder = pathFinder;
 }
Пример #21
0
        private void InitializeGameStates()
        {
            stateSystem = new StateSystem();

            // Add game states
            stateSystem.AddState("start_menu", new StartMenuState(stateSystem, textureManager, input, gameData));
            stateSystem.AddState("controls", new ControlsState(input, stateSystem, textureManager));
            stateSystem.AddState("inner_game", new InnerGameState(input, stateSystem, textureManager, gameData, effectsManager));
            stateSystem.AddState("game_over", new GameOverState(input, stateSystem, gameData, textureManager));

            // Set starting state
            stateSystem.ChangeState("start_menu");
        }