Beispiel #1
0
        public virtual void Update(float TimeEllapsed)
        {
            Position   += Speed * TimeEllapsed;
            Speed      += SuperTank2.Gravity * TimeEllapsed;
            PositionOld = Position;

            Angle = (float)Math.Atan2(Speed.Y, Speed.X);

            UpdateTransformationMatrix();

            if (Position.Y > 740)
            {
                Resist = 0;
                GroundExplosion.AddGroundExplosion(new GroundExplosion(new Vector2(Position.X, 730)));
            }
            else if (Position.X < -10 || Position.Y < 0)
            {
                Resist = 0;
            }

            int ParticleCount = 10;

            for (int i = 0; i < ParticleCount; i++)
            {
                new Propulsor(Position, Angle + (15 - (float)SuperTank2.Randomizer.NextDouble() * 30) * SuperTank2.DegToRad, -SuperTank2.Randomizer.NextDouble() * 5).AddParticule();
            }
        }
Beispiel #2
0
            public override void Update(float TimeEllapsed)
            {
                AnimationPosition += 0.2f;
                if (AnimationPosition >= AnimationFrameCount)
                {
                    AnimationPosition -= AnimationFrameCount;
                }

                SpriteSource.X = (int)Math.Floor(AnimationPosition) * SpriteWidth;

                if (Position.Y < 640)
                {
                    Angle = SuperTank2.TurnToFace(Position, Near.Position, Angle, TurnSpeed);
                }

                Speed.X = (float)Math.Cos(Angle) * 3 * TimeEllapsed;
                Speed.Y = (float)Math.Sin(Angle) * 3 * TimeEllapsed;

                Position += Speed;

                UpdateTransformationMatrix();

                if (Position.Y > 740)
                {
                    for (int i = 0; i < 5; i++)
                    {
                        new FlameParticle(Position, (60 + SuperTank2.Randomizer.Next(60)) * SuperTank2.DegToRad, 2 + SuperTank2.Randomizer.NextDouble() * 5).AddParticule();
                        Smoke.AddSmoke(new BombSmoke(Position, (80 + SuperTank2.Randomizer.Next(20)) * SuperTank2.DegToRad, 0));
                    }
                    GroundExplosion.AddGroundExplosion(new GroundExplosion(new Vector2(Position.X, 730)));
                    Resist = 0;
                }
                new Propulsor(Position, Angle, -SuperTank2.Randomizer.NextDouble() * 5).AddParticule();
            }
        public static void AddGroundExplosion(GroundExplosion NewGroundExplosion)
        {
            for (int P = 0; P < GroundExplosion.ListGroundExplosion.Count; P++)
            {
                if (!GroundExplosion.ListGroundExplosion[P].IsAlive)
                {
                    GroundExplosion.ListGroundExplosion[P] = NewGroundExplosion;
                    return;
                }
            }

            GroundExplosion.ListGroundExplosion.Add(NewGroundExplosion);
        }
Beispiel #4
0
            public override void Update(float TimeEllapsed)
            {
                Speed.Y  += 0.1f;
                Position += Speed * TimeEllapsed;
                new BombFlame(BombSprite, Position).AddParticule();

                UpdateTransformationMatrix();

                if (Position.Y > 740)
                {
                    Resist = 0;
                    GroundExplosion.AddGroundExplosion(new LaserExplosion(new Vector2(Position.X, 730)));
                }
            }