コード例 #1
0
 public void Remove(Enemy i_Enemy)
 {
     foreach (List<Enemy> enemyRow in r_EnemiesMatrix)
     {
         enemyRow.Remove(i_Enemy);
     }
 }
コード例 #2
0
        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;
        }