Пример #1
0
        protected override Victim Clone()
        {
            VictimLeaf copyObject = new VictimLeaf(this.megatile, this.GroundAnimation.Copy(), this.StumpAnimation.Copy(), this.ExplodeAnimation.Copy(), this.TornadoAnimation.Copy(), soundHit, pos);
            copyObject.GroundHealth = this.GroundHealth;
            copyObject.TornadoHealth = this.TornadoHealth;
            copyObject.Mass = this.Mass;
            copyObject.state = this.state;
            copyObject.tornado = this.tornado;

            return copyObject;
        }
Пример #2
0
        public Tornado(Level level, Vector2 position, float lifeDecayRatio)
        {
            ParentLevel = level;

            // initialize variables
            Victims = new List<Victim>();
            Debris = new List<Victim>();
            Position = position;
            Velocity = new Vector2(0f, 0f);
            Acceleration = new Vector2(0f, 0f);
            RotationalSpeed = 10f;
            DamageFactor = 0f;
            Radius = 100.0f;
            TotalMass = 0.0f;
            MaxLife = 1000f;
            Life = MaxLife;
            LifeDecayRatio = lifeDecayRatio;
            Category = TornadoCategory.Gale;
            CategoryValue = 0f;
            MouseControl = new MouseControl();
            GodMode = false;

            CenterFont = ParentLevel.Game.Content.Load<SpriteFont>(@"Graphics\Font\Impact");

            // add the constant debris
            for (int i = 0; i < 20; i++)
            {
                Animation leafAnim = new Animation(ParentLevel.Game.Content.Load<Texture2D>("Graphics\\Objects\\leaf"), 10, 4, 1);
                Victim debris = new VictimLeaf(null,leafAnim,leafAnim,leafAnim,leafAnim, "", Position);

                debris.tornado = this;
                debris.state = Victim.State.Flying;
                Victims.Add(debris);
            }

            ParentLevel.Music.Play(0, true);
        }