本文整理汇总了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);
}
}
示例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();
}
示例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();
}