示例#1
0
 //  The new attack code
 public override void Attack(GameObject target, ContentManager content, ProjectileManager projMan)
 {
     //if (!rapidFireTimer.Enabled)
     //{
     //    specialAttack = false;
     //    attackSpeed = 180;
     //}
     attackSound(content);
     Vector2 corrected = Vector2.Add(position, new Vector2(16, 16));
     Projectile projectile = new Arrow(corrected, 100, target, 100, 0);
     myArrow = projectile;
     Vector2 direction = MovementManager.getNormalizedVector(projectile.position, target.position);
     projectile.setDestination(direction, target.position);
     projectile.LoadContent(content);
     projMan.proj.Add(projectile);
     this.animateState = "attack";
     this.animateTime = 0;
 }
示例#2
0
 public override void Attack(GameObject target, ContentManager content, ProjectileManager projMan)
 {
     attackSound(content);
     Vector2 corrected = Vector2.Add(position, new Vector2(16, 16));
     Projectile projectile = new Arrow(corrected, 100, target, 100, 0);
     projectile.damage = this.damage;
     Vector2 direction = MovementManager.getNormalizedVector(projectile.position, target.position);
     projectile.setDestination(direction, target.position);
     projectile.LoadContent(content);
     projMan.proj.Add(projectile);
 }