Ejemplo n.º 1
0
        /*      public Random randX;
        public Random randY;
        */
        public Meteor(Rectangle position, ContentManager contentRef)
            : base(position, contentRef)
        {
            velocity = new Vector2((float)rand.Next(-5, 5), rand.Next(1, 3));
            //velocity = new Vector2(0, 1);

            currentVelocity = velocity;

            totalHP = rand.Next(1, 5);
            currentHP = totalHP;

            position.Width = 35 + totalHP * 5;
            position.Height = 35 + totalHP * 5;

            active = true;
            frozen = false;

            frozenTexture = contentRef.Load<Texture2D>("Block3");
            texture = contentRef.Load<Texture2D>("Meteor");
            fireTexture = contentRef.Load<Texture2D>("vortex");

            fireEmitter = new FireEmitter(fireTexture, position, .6f);
        }
Ejemplo n.º 2
0
        public Meteor(Rectangle position, ContentManager contentRef, int hp, Vector2 velocity)
            : base(position, contentRef)
        {
            if (hp > 0)
            {

                this.velocity = velocity;
                currentVelocity = velocity;

                totalHP = hp;
                currentHP = hp;

                position.Width = 35 + totalHP * 5;
                position.Height = 35 + totalHP * 5;

                frozen = false;
            }
            else
            {
                totalHP = hp;
                currentHP = hp;
                velocity = new Vector2(0, 0);
                currentVelocity.Y = 0;
                frozen = true;
            }
            active = true;

            frozenTexture = contentRef.Load<Texture2D>("Block3");
            texture = contentRef.Load<Texture2D>("Meteor");

            fireTexture = contentRef.Load<Texture2D>("vortex");

            fireEmitter = new FireEmitter(fireTexture, position, .6f);
        }