// TyDo: Create a new projectile that deals less damage than an arrow, but for now just make it the fireball // Attack the target (not homing). Create a new object projectile sent in the direction of target // The new attack code public override void Attack(GameObject target, ContentManager content, ProjectileManager projMan) { this.soundEffect = content.Load<SoundEffect>("fireball.wav"); soundEffect.Play(); Vector2 corrected = Vector2.Add(position, new Vector2(16, 16)); Projectile projectile = new Iceball(corrected, 0, target, 1, 0); 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; }
// TyDo: Create a new projectile that deals less damage than an arrow, but for now just make it the fireball // Attack the target (not homing). Create a new object projectile sent in the direction of target // The new attack code public override void Attack(GameObject target, ContentManager content, ProjectileManager projMan) { this.soundEffect = content.Load <SoundEffect>("fireball.wav"); soundEffect.Play(); Vector2 corrected = Vector2.Add(position, new Vector2(16, 16)); Projectile projectile = new Iceball(corrected, 0, target, 1, 0); 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; }