Exemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="ID"></param>
 /// <param name="sprite"></param>
 /// <param name="pos"></param>
 /// <param name="vel"></param>
 /// <param name="damage"></param>
 /// <param name="knockback"></param>
 /// <param name="lifespan"></param>
 /// <param name="room"></param>
 /// <param name="friendly"></param>
 /// <param name="useFriction"></param>
 /// <param name="useGravity"></param>
 /// <param name="useResistance"></param>
 /// <param name="bounceFactor"></param>
 /// <param name="dieOnCollision"></param>
 /// <param name="spriteEffect"></param>
 public Projectile(int ID, string sprite, Vector2 pos, Vector2 vel, float damage, float knockback, float lifespan, Room room, bool friendly, bool useFriction, bool useGravity, bool useResistance, float bounceFactor, bool dieOnCollision, SpriteEffects spriteEffect, List <GameObject.Types> attackable, bool lookAtMovement) : base(new Rectangle((int)pos.X, (int)pos.Y, SpriteHandler.sprites[sprite].width, SpriteHandler.sprites[sprite].height), 0, room, sprite)
 {
     this.lookAtMovement = lookAtMovement;
     type = Types.Projectile;
     this.spriteEffect  = spriteEffect;
     this.isFriendly    = friendly;
     this.ID            = ID;
     movement           = vel;
     this.Damage        = damage;
     this.Knockback     = knockback;
     this.Lifespan      = lifespan * 60;
     base.useFriction   = useFriction;
     base.useGravity    = useGravity;
     base.useResistance = useResistance;
     base.bounceFactor  = bounceFactor;
     dieOnCol           = dieOnCollision;
     damageZone         = new DamageZone(new Rectangle((int)pos.X, (int)pos.Y, (int)((float)(SpriteHandler.sprites[sprite].width)), (int)((float)(SpriteHandler.sprites[sprite].height))), Damage, 60, 0, ID, true, true, attackable);
     room.damageZones.Add(damageZone);
     angle = (float)Math.Atan2(movement.Y, movement.X);
 }
Exemplo n.º 2
0
 public Projectile(int ID, Animation ani, Vector2 pos, Vector2 vel, float damage, float knockback, float lifespan, Room room, bool friendly, bool useFriction, bool useGravity, bool useResistance, float bounceFactor, bool dieOnCollision, SpriteEffects spriteEffect, List <GameObject.Types> attackable, bool lookAtMovement, float friction, float resistance, float scale) : base(new Rectangle((int)pos.X, (int)pos.Y, (int)(ani.Width * scale), (int)(ani.Height * scale)), 0, room, "")
 {
     this.lookAtMovement = lookAtMovement;
     this.ID             = ID;
     type = Types.Projectile;
     this.spriteEffect  = spriteEffect;
     animation          = ani;
     this.isFriendly    = friendly;
     base.friction      = friction;
     base.airResitance  = resistance;
     movement           = vel;
     this.Damage        = damage;
     this.Knockback     = knockback;
     this.Lifespan      = lifespan * 60;
     base.useFriction   = useFriction;
     base.useGravity    = useGravity;
     base.useResistance = useResistance;
     base.bounceFactor  = bounceFactor;
     dieOnCol           = dieOnCollision;
     damageZone         = new DamageZone(new Rectangle((int)pos.X, (int)pos.Y, (int)((float)(ani.Width * scale)), (int)((float)(ani.Height * scale))), Damage, 60, 0, ID, true, true, attackable);
     room.damageZones.Add(damageZone);
     angle = (float)Math.Atan2(movement.Y, movement.X);
 }