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; }
public BossEnemy(ContentManager Content, int i_ChanceDrop, float f_Health, float f_Speed, String t2d_Tex = "Entities/Boss") : base(Content, i_ChanceDrop, t2d_Tex) { pProjectile = new Projectile(Content, new Vector2(),(int)(new Vector2(Texture.Width/2,Texture.Height/2).Length()), "Objects/Rock"); bAgro = true; States = AIState.ATTACK; Position = new Vector2(Neuroleptic.Control.Rand.Next(80, 882), Neuroleptic.Control.Rand.Next(48, 445)); UpdateIndex(); Speed = f_Speed; iChanceDrop = i_ChanceDrop; HealthCurrent = HealthMax = f_Health; fAttackDamage = 2.0f; fAnimationMax = 200.0f; }
public new void xmlImport(XmlReader xml_Reader, ContentManager Content) { while (xml_Reader.Read()) { String attrib; //Console.WriteLine("BossEnemy : " + xml_Reader.Name); switch (xml_Reader.Name) { case "Enemy": base.xmlImport(xml_Reader, Content); break; case "Projectile": int iLength = 500; attrib = xml_Reader["Length"]; if (attrib != null) { iLength = int.Parse(attrib); } attrib = xml_Reader["Name"]; if (attrib != null) { pProjectile = new Projectile(Content, new Vector2(), iLength, attrib); } else { pProjectile = new Projectile(Content, new Vector2(), iLength, "Objects/Rock"); } attrib = xml_Reader["ShootTimer"]; if (attrib != null) { iShootTimer = iShootMax = int.Parse(attrib); } break; case "BossEnemy": return; } } }
protected void Shoot() { if (iShootTimer <= 0) { iShootTimer = iShootMax; //v2Projectile = Position; v2Direction = (Game1.ePlayer.Position - Position); //v2Direction += new Vector2(Control.Rand.Next(-128, 128), Control.Rand.Next(-128, 128)); if (v2Direction != Vector2.Zero) v2Direction.Normalize(); Projectile p = new Projectile(pProjectile); p.Position = Position; p.Velocity = v2Direction; Rooms.RoomManager.CurrentRoom.AddProjectile(p); } }