Пример #1
0
        private Spacecraft(GameWorld gameWorld, Vector2 gamePosition)
            : base(gameWorld, gamePosition)
        {
            energy = 100;
            dead = false;
            myCount = ++count;

            switch (MyMath.Random.Next(4))
            {
                case 0:
                    myTexture = new MyTexture(MyContentManager.Spacecraft0);
                    myTextureOverlay = new MyTexture(MyContentManager.Spacecraft0_Overlay);
                    break;
                case 1:
                    myTexture = new MyTexture(MyContentManager.Spacecraft1);
                    myTextureOverlay = new MyTexture(MyContentManager.Spacecraft1_Overlay);
                    break;
                case 2:
                    myTexture = new MyTexture(MyContentManager.Spacecraft2);
                    myTextureOverlay = new MyTexture(MyContentManager.Spacecraft2_Overlay);
                    break;
                case 3:
                    myTexture = new MyTexture(MyContentManager.Spacecraft3);
                    myTextureOverlay = new MyTexture(MyContentManager.Spacecraft3_Overlay);
                    break;
                default:
                    throw new Exception();
            }

            color = new Color(Color1(), Color1(), Color1());
            colorOverlay = new Color(Color1(), Color1(), Color1());
        }
 public BulletExplosion(GameWorld gameWorld, Vector2 gamePosition, float energy) : base(gameWorld, gamePosition)
 {
     this.energy    = energy;
     smoke          = new MyTexture(MyContentManager.Smoke);
     explosion      = new MyTexture(MyContentManager.Explosion);
     explosionFrame = 0;
 }
Пример #3
0
 public Bullet(GameWorld gameWorld, Vector2 gamePosition, Vector2 velocity, int ownerId)
     : base(gameWorld, gamePosition)
 {
     this.ownerId = ownerId;
     myTexture    = new MyTexture(MyContentManager.Bullet);
     myCount      = count++;
     CreateBullet(gamePosition, velocity);
 }
Пример #4
0
 public Bullet(GameWorld gameWorld, Vector2 gamePosition, Vector2 velocity, int ownerId)
     : base(gameWorld, gamePosition)
 {
     this.ownerId = ownerId;
     myTexture = new MyTexture(MyContentManager.Bullet);
     myCount = count++;
     CreateBullet(gamePosition, velocity);
 }
Пример #5
0
 public BulletExplosion(GameWorld gameWorld, Vector2 gamePosition, float energy)
     : base(gameWorld, gamePosition)
 {
     this.energy = energy;
     smoke = new MyTexture(MyContentManager.Smoke);
     explosion = new MyTexture(MyContentManager.Explosion);
     explosionFrame = 0;
 }
Пример #6
0
        private Spacecraft(GameWorld gameWorld, Vector2 gamePosition) :
            base(gameWorld, gamePosition)
        {
            energy  = 100;
            dead    = false;
            myCount = ++count;

            switch (MyMath.Random.Next(4))
            {
            case 0:
                myTexture        = new MyTexture(MyContentManager.Spacecraft0);
                myTextureOverlay = new MyTexture(MyContentManager.Spacecraft0_Overlay);
                break;

            case 1:
                myTexture        = new MyTexture(MyContentManager.Spacecraft1);
                myTextureOverlay = new MyTexture(MyContentManager.Spacecraft1_Overlay);
                break;

            case 2:
                myTexture        = new MyTexture(MyContentManager.Spacecraft2);
                myTextureOverlay = new MyTexture(MyContentManager.Spacecraft2_Overlay);
                break;

            case 3:
                myTexture        = new MyTexture(MyContentManager.Spacecraft3);
                myTextureOverlay = new MyTexture(MyContentManager.Spacecraft3_Overlay);
                break;

            default:
                throw new Exception();
            }

            color        = new Color(Color1(), Color1(), Color1());
            colorOverlay = new Color(Color1(), Color1(), Color1());
        }
Пример #7
0
 public Background(GameWorld gameWorld)
     : base(gameWorld,new Vector2())
 {
     myTexture = new MyTexture(MyContentManager.Background, 2);
 }
Пример #8
0
 public Background(GameWorld gameWorld) : base(gameWorld, new Vector2())
 {
     myTexture = new MyTexture(MyContentManager.Background, 2);
 }