Initialize() публичный Метод

public Initialize ( ) : void
Результат void
Пример #1
0
        public override void Initialize()
        {
            _backgroundMainRectangle = new Rectangle(0, 0, Config.GameArea.X, Config.GameArea.Y);
            _backgroundTopRectangle = new Rectangle(0, -Config.GameArea.Y, Config.GameArea.X, Config.GameArea.Y);

            _playTime = TimeSpan.Zero;

            _enemy = new Boss(GameRef);

            Players.Clear();
            _singlePlayer = (Config.PlayersNumber == 1);

            // First player
            var player1 = new Player(GameRef, leftView, 1, Config.PlayersController[0],
                                        new Vector2(Config.GameArea.X / 2f,
                                                    Config.GameArea.Y - 150));
            player1.Initialize();
            Players.Add(player1);

            // Second player
            if (!_singlePlayer)
            {
                var player2 = new Player(GameRef, rightView, 2, Config.PlayersController[1],
                                        new Vector2(Config.GameArea.X / 2f,
                                                    Config.GameArea.Y - 150));
                player2.Initialize();
                Players.Add(player2);
            }

            _enemy.Initialize();
            _waveNumber = 0;

            _timer.Initialize();

            base.Initialize();

            _bloom.Initialize();

            MediaPlayer.IsRepeating = true;
            MediaPlayer.Play(GameRef.Content.Load<Song>("Audio/Musics/Background"));

            _timer.Initialize();
        }
Пример #2
0
        public override void Initialize()
        {
            _backgroundMainRectangle = new Rectangle(0, 0, Config.GameArea.X, Config.GameArea.Y);

            base.Initialize();

            _bloom.Initialize();

            _defaultView = GraphicsDevice.Viewport;

            Players.Clear();

            // First player
            var player1 = new Player(GameRef, _defaultView, 1, Config.PlayersController[0], new Vector2(Config.GameArea.X / 2f, Config.GameArea.Y - Config.GameArea.Y / 4f));
            player1.Initialize();
            Players.Add(player1);

            _boss = new Boss(GameRef, Players, Config.MinBossIteration);
            _boss.Initialize();
        }
        public override void Initialize()
        {
            _backgroundMainRectangle = new Rectangle(0, 0, Config.GameArea.X, Config.GameArea.Y);

            // Bullet manager
            _moverManager = new MoverManager((DnK)Game);
            GameManager.GameDifficulty = Config.GameDifficultyDelegate;

            base.Initialize();

            _defaultView = GraphicsDevice.Viewport;

            // First player
            _player = new Player(GameRef, _defaultView, 1, Config.PlayersController[0], new Vector2(Config.GameArea.X / 2f, Config.GameArea.Y - 150));
            _player.Initialize();

            _moverManager.Initialize(_player.GetPosition);
            _moverManager.movers.Clear();

            AddBullet(true);

            // Watch the bullet pattern file
            _watcher = new FileSystemWatcher
            {
                Path = _patternDirectory,
                NotifyFilter = NotifyFilters.LastWrite,
                Filter = _patternFileName
            };

            // Add event handler
            _watcher.Changed += OnChanged;

            // Begin watching
            _watcher.EnableRaisingEvents = true;
        }