当前位置: 首页>>代码示例>>C#>>正文


C# Boss.Initialize方法代码示例

本文整理汇总了C#中Boss.Initialize方法的典型用法代码示例。如果您正苦于以下问题:C# Boss.Initialize方法的具体用法?C# Boss.Initialize怎么用?C# Boss.Initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Boss的用法示例。


在下文中一共展示了Boss.Initialize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddEnemy

 public static void AddEnemy(GameplayScreen gameplayScreen, string name, Vector2 position, GameCharacter target)
 {
     if(name.StartsWith("Gr"))
     {
         var g = new Grunt(gameplayScreen){Center = position};
         g.Initialize();
         g.Name = name;
         if(target != null)
         g.Target = target;
         _enemies.Add(g);
     }
     else if(name.StartsWith("So"))
     {
         var m = new Soldier(gameplayScreen) { Center = position };
         m.Initialize();
         m.Name = name;
         m.Target = target;
         _enemies.Add(m);
         NumSoldiers += 1;
     }
     else if(name.StartsWith("Sp"))
     {
         var s = new Spawner(gameplayScreen) { Center = position };
         s.Initialize();
         s.Name = name;
         s.Target = target;
         _enemies.Add(s);
     }
     else if(name.StartsWith("Bo"))
     {
         _boss = new Boss(gameplayScreen) { Center = position };
         _boss.Initialize();
         _boss.Name = name;
         NumBosses++;
         _boss.Target = target;
         _enemies.Add(_boss);
         _boss.Died += new DeathEventHandler(_boss_Died);
     }
 }
开发者ID:ruairitobrien,项目名称:Nathaniel-WP7,代码行数:39,代码来源:EnemyManager.cs

示例2: Initialize

        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();
        }
开发者ID:Noxalus,项目名称:Danmaku-no-Kyojin,代码行数:20,代码来源:DebugScreen.cs

示例3: Initialize

        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);

            _singlePlayer = (Config.PlayersNumber == 1);

            _waveNumber = 0;

            _timer.Initialize();

            base.Initialize();

            _bloom.Initialize();

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

            _timer.Initialize();

            defaultView = GraphicsDevice.Viewport;
            leftView = defaultView;
            rightView = defaultView;

            if (!_singlePlayer)
            {
                leftView.Width = leftView.Width / 2;
                rightView.Width = rightView.Width / 2;
                rightView.X = leftView.Width;
            }

            Players.Clear();

            // 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();
        }
开发者ID:Noxalus,项目名称:Danmaku-no-Kyojin,代码行数:56,代码来源:GameplayScreen.cs


注:本文中的Boss.Initialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。