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


C# GameScreen.Add方法代码示例

本文整理汇总了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);
 }
开发者ID:BorisBorshevsky,项目名称:MonoGameSpaceInvanders,代码行数:7,代码来源:RegisteredComponent.cs

示例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);
 }
开发者ID:BorisBorshevsky,项目名称:MonoGameSpaceInvanders,代码行数:7,代码来源:Sprite.cs

示例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);
 }
开发者ID:BorisBorshevsky,项目名称:MonoGameSpaceInvanders,代码行数:7,代码来源:ScoresBoard.cs

示例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;
        }
开发者ID:barcohen10,项目名称:Space-Invaders,代码行数:65,代码来源:SpritesFactory.cs


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