本文整理汇总了C#中GameScreen.Add方法的典型用法代码示例。如果您正苦于以下问题:C# GameScreen.Add方法的具体用法?C# GameScreen.Add怎么用?C# GameScreen.Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameScreen
的用法示例。
在下文中一共展示了GameScreen.Add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisteredComponent
public RegisteredComponent(GameScreen i_GameScreen, int i_UpdateOrder = int.MaxValue)
: base(i_GameScreen.Game)
{
Screen = i_GameScreen;
UpdateOrder = i_UpdateOrder;
i_GameScreen.Add(this);
}
示例2: Sprite
public Sprite(string i_AssetName, GameScreen i_Game, int i_UpdateOrder, int i_DrawOrder)
: base(i_AssetName, i_Game.Game, i_UpdateOrder, i_DrawOrder)
{
AngularVelocity = 0;
Screen = i_Game;
Screen.Add(this);
}
示例3: ScoresBoard
public ScoresBoard(GameScreen i_GameScreen, int i_PlayerNumber, Color i_TextColor)
: base(i_GameScreen.Game)
{
r_TextColor = i_TextColor;
r_PlayerNumber = i_PlayerNumber;
i_GameScreen.Add(this);
}
示例4: CreateSprite
public static Sprite CreateSprite(GameScreen i_GameScreen, eSpriteType i_SpriteType)
{
Sprite sprite = null;
switch (i_SpriteType)
{
case eSpriteType.Bullet:
sprite = new Bullet(i_GameScreen, k_BulletAsset);
break;
case eSpriteType.EnemyLightBlue:
sprite = new Enemy(i_GameScreen, Color.LightBlue, 2, 4, k_EnemysAsset);
break;
case eSpriteType.EnemyPink:
sprite = new Enemy(i_GameScreen, Color.Pink, 0, 2, k_EnemysAsset);
break;
case eSpriteType.EnemyYellow:
sprite = new Enemy(i_GameScreen, Color.Yellow, 4, 6, k_EnemysAsset);
break;
case eSpriteType.MotherShip:
sprite = new MotherShip(i_GameScreen, k_MotherSpaceShipAsset);
break;
case eSpriteType.SpaceBackground:
sprite = new SpaceBackground(i_GameScreen, k_SpaceBGAsset);
break;
case eSpriteType.BlueSpaceShip:
sprite = new SpaceShip(i_GameScreen, k_BlueSpaceShipAsset);
break;
case eSpriteType.GreenSpaceShip:
sprite = new SpaceShip(i_GameScreen, k_GreenSpaceShipAsset);
break;
case eSpriteType.Barrier:
sprite = new Barrier(i_GameScreen, k_BarrierAsset);
break;
case eSpriteType.SmallText:
sprite = new Text(i_GameScreen, k_CalibriSmallFontAsset);
break;
case eSpriteType.MediumText:
sprite = new Text(i_GameScreen, k_CalibriMediumFontAsset);
break;
case eSpriteType.BigText:
sprite = new Text(i_GameScreen, k_CalibriBigFontAsset);
break;
case eSpriteType.LifeBlueSpaceShip:
sprite = new Life(i_GameScreen, k_BlueSpaceShipAsset);
break;
case eSpriteType.LifeGreenSpaceShip:
sprite = new Life(i_GameScreen, k_GreenSpaceShipAsset);
break;
case eSpriteType.Mouse:
sprite = new MouseSprite(i_GameScreen, k_MouseAsset);
break;
}
sprite.Initialize();
i_GameScreen.Add(sprite);
return sprite;
}