Пример #1
0
 public Projectile(Projectile other)
     : base(other)
 {
     v2Velocity = other.v2Velocity;
     rCollisionBox = other.rCollisionBox;
     peEmitter = new Particle.Emitter(other.peEmitter);
     peEmitter.Play();
     peEmitterExplode = new Particle.Emitter(other.peEmitterExplode);
     peEmitterExplode.Stop();
     fDamage = other.fDamage;
     iTimer = other.iTimer;
 }
Пример #2
0
 public Projectile(ContentManager Content, Vector2 v2_Velocity,int i_Timer, string s_Tex)
     : base(Content, s_Tex)
 {
     rCollisionBox = new Rectangle((int)Position.X, (int)Position.Y, FrameWidth, FrameHeight);
     v2Velocity = v2_Velocity;
     peEmitterExplode = Particle.Emitter.Explode(Content, v2_Velocity, s_Tex);
     peEmitterExplode.Stop();
     peEmitterExplode.Colour = Color.Tan;
     peEmitter = Particle.Emitter.Projectile(Content, v2_Velocity, s_Tex);
     peEmitter.Reset();
     Origin = new Vector2(16, 16);
     fDamage = 5;
     iTimer = i_Timer;
 }
Пример #3
0
        public Entity(Entity other)
            : base(other)
        {
            bDrawHealth = other.bDrawHealth;

            fHealthCurrent = fHealthMax = other.fHealthCurrent = other.fHealthMax;
            fSpeed = other.fSpeed;

            rCollisionBox = other.rCollisionBox;
            seHit = other.seHit;
            v2Velocity = other.v2Velocity;
            peEmitter = new Particle.Emitter(other.peEmitter);
            peEmitter.Stop();

            asHealth = other.asHealth;
        }
Пример #4
0
        public Entity(ContentManager Content, String t2d_Tex = "image")
            : base(Content, t2d_Tex)
        {
            fHealthCurrent = fHealthMax = 5.0f;
            fSpeed = 0.5f;

            rCollisionBox = new Rectangle(0, 0, FrameWidth, FrameHeight);
            seHit = Content.Load<SoundEffect>("Entities/Sound/hit02");
            v2Velocity = new Vector2(0, 0);

            asHealth = new AnimatedSprite(Content, "pixel");
            bDrawHealth = false;

            peEmitter = Particle.Emitter.Burst(Content);
            peEmitter.Stop();
        }
Пример #5
0
 public new void xmlImport(XmlReader xml_Reader, ContentManager Content)
 {
     asHealth = new AnimatedSprite(Content, "pixel");
     peEmitter = Particle.Emitter.Burst(Content);
     peEmitter.Stop();
     seHit = Content.Load<SoundEffect>("Entities/Sound/hit02");
     while (xml_Reader.Read())
     {
         String attrib;
         //Console.WriteLine("Entity : " + xml_Reader.Name);
         switch (xml_Reader.Name)
         {
             case "Variables":
                 attrib = xml_Reader["DrawHealth"];
                 if (attrib != null) { bDrawHealth = bool.Parse(attrib); }
                 attrib = xml_Reader["HealthMax"];
                 if (attrib != null) { fHealthCurrent = fHealthMax = float.Parse(attrib); }
                 attrib = xml_Reader["Speed"];
                 if (attrib != null) { fSpeed = float.Parse(attrib); }
                 break;
             case "CollisionBox":
                 attrib = xml_Reader["X"];
                 if (attrib != null) { rCollisionBox.X = int.Parse(attrib); }
                 attrib = xml_Reader["Y"];
                 if (attrib != null) { rCollisionBox.Y = int.Parse(attrib); }
                 attrib = xml_Reader["W"];
                 if (attrib != null) { rCollisionBox.Width = int.Parse(attrib); }
                 attrib = xml_Reader["H"];
                 if (attrib != null) { rCollisionBox.Height = int.Parse(attrib); }
                 break;
             case "Velocity":
                 String attribX = xml_Reader["X"];
                 String attribY = xml_Reader["Y"];
                 if (attribX != null && attribY != null) { v2Velocity = new Vector2(float.Parse(attribX), float.Parse(attribY)); }
                 break;
             case "AnimatedSprite":
                 base.xmlImport(xml_Reader, Content);
                 break;
             case "Entity":
                 return;
         }
     }
 }