コード例 #1
0
 public InnerGameState(StateSystem system, Input input, TextureManager textureManager,
                         PersistantGameData gameData, Font generalFont)
 {
     _textureManager = textureManager;
     _input = input;
     _system = system;
     _gameData = gameData;
     _generalFont = generalFont;
     OnGameStart();
 }
コード例 #2
0
        public InnerGameState(Input input, StateSystem system, TextureManager textureManager, SoundManager soundManager, LevelManager levelManager, PersistantGameData gameData, Font generalFont, Font titleFont)
        {
            _input          = input;
            _system         = system;
            _gameData       = gameData;
            _titleFont      = titleFont;
            _generalFont    = generalFont;
            _soundManager   = soundManager;
            _levelManager   = levelManager;
            _textureManager = textureManager;
            _score          = new GUI("Score", generalFont, new Vector(400, 350, 0));
            _lives          = new GUI("Lives", generalFont, new Vector(-600, 350, 0));

            OnGameStart();
        }
コード例 #3
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);
        }
コード例 #4
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);
        }
コード例 #5
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);
        }
コード例 #6
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);
        }
コード例 #7
0
        public GameOverState(PersistantGameData 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);
        }
コード例 #8
0
        public GameOverState(PersistantGameData 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);
        }
コード例 #9
0
ファイル: Level.cs プロジェクト: RomanZhdanov/Shooter
        public Level(Input input, TextureManager textureManager, PersistantGameData gameData, SoundManager soundManager, PotatoEngine.Font generalFont)
        {
            _input          = input;
            _textureManager = textureManager;
            _soundManager   = soundManager;
            _gameData       = gameData;

            _background = new ScrollingBackground(_textureManager.Get("background"));
            _background.SetScale(2, 2);
            _background.Speed = 0.15f;

            _backgroundLayer = new ScrollingBackground(_textureManager.Get("background_layer_1"));
            _backgroundLayer.SetScale(2, 2);
            _backgroundLayer.Speed = 0.1f;

            _planet_28         = new Sprite();
            _planet_28.Texture = _textureManager.Get("planet_28");
            _planet_28.SetScale(0.5, 0.5);
            _planet_28.SetPosition(300, -300);

            _playArea        = new RectangleF(-1260 / 2, -750 / 2, 1260, 750);
            _bulletManager   = new BulletManager(_playArea);
            _effectsManager  = new EffectsManager(_textureManager);
            _playerCharacter = new PlayerCharacter(_textureManager, _effectsManager, _bulletManager, _playArea);

            if (_gameData.NewGame)
            {
                _playerCharacter.Lives = _startLives;
                _playerCharacter.Score = 0;
            }
            else
            {
                _playerCharacter.Lives = _gameData.Lives;
                _playerCharacter.Score = _gameData.Score;
            }

            _enemyManager = new EnemyManager(_textureManager, _effectsManager, _bulletManager, _playerCharacter, _playArea, _gameData.CurrentLevel.Enemies, -1300);

            Finished = false;
        }
コード例 #10
0
ファイル: Level.cs プロジェクト: pixare40/gerishom-basweti
        public Level(Input input, TextureManager textureManager, PersistantGameData gameData)
        {
            _input = input;
            _gameData = gameData;
            _textureManager = textureManager;
            _effectsManager = new EffectsManager(_textureManager);
            _playerCharacter = new PlayerCharacter(_textureManager, _bulletManager);

            // -1300 is bad for two reasons
            // 1. It's a magic number in the middle of the code
            // 2. It's based on the size of the form but doesn't directly reference the size of the form
            // this means duplication and two places to edit the code if the form size changes.
            // The form size and the enemy manager play area size should both get their value
            // from one central place.
            _enemyManager = new EnemyManager(_textureManager, _effectsManager, _bulletManager, _playerCharacter, -1300);

            _background = new ScrollingBackground(textureManager.Get("background"));
            _background.SetScale(2, 2);
            _background.Speed = 0.15f;

            _backgroundLayer = new ScrollingBackground(textureManager.Get("background_layer_1"));
            _backgroundLayer.Speed = 0.1f;
            _backgroundLayer.SetScale(2.0, 2.0);
        }