From b5224f10aa3318b69ed3c2dfa06b5795d13aada0 Mon Sep 17 00:00:00 2001 From: AnloGames <7383an@gmail.com> Date: Fri, 18 Aug 2023 19:41:52 +0300 Subject: [PATCH] sascsacas --- .../LivingEntities/Player/Player.cs | 34 ++++--------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/Player/Player.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Player/Player.cs index afffe9a..deb8ae4 100644 --- a/DangerousD/GameCore/GameObjects/LivingEntities/Player/Player.cs +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Player/Player.cs @@ -193,19 +193,9 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities if (!isUping) { StartCicycleAnimation("playerShootRight"); - var targets = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X, (int)(Pos.Y - 10f), shootLength + 24, 10), typeof(Zombie)).OrderBy(x => (x.Pos - Pos).LengthSquared()); - if (targets.Count() > 0) - { - Zombie targetZombie = (Zombie)targets.First(); - targetZombie.TakeDamage(); - } - targets = AppManager.Instance.GameManager.physicsManager.CheckRectangle(GetShootRectangle(isRight), typeof(SilasHands)).OrderBy(x => (x.Pos - Pos).LengthSquared()); - if (targets.Count() > 0) - { - SilasHands targetHand = (SilasHands)targets.First(); - targetHand.TakeDamage(); - } - SmokeAfterShoot smokeAfterShoot = new SmokeAfterShoot(new Vector2(Pos.X + 30, Pos.Y + 7)); + Bullet bullet = new Bullet(new Vector2(Pos.X + 16, Pos.Y)); + bullet.ShootRight(); + SmokeAfterShoot smokeAfterShoot = new SmokeAfterShoot(new Vector2(Pos.X + 12, Pos.Y - 8)); } else { @@ -219,20 +209,10 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities { if (!isUping) { - StartCicycleAnimation("playerShootLeft"); - var targets = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X, (int)(Pos.Y - 10f), shootLength + 24, 10), typeof(Zombie)).OrderBy(x => (x.Pos - Pos).LengthSquared()); - if (targets.Count() > 0) - { - Zombie targetZombie = (Zombie)targets.First(); - targetZombie.TakeDamage(); - } - targets = AppManager.Instance.GameManager.physicsManager.CheckRectangle(GetShootRectangle(isRight), typeof(SilasHands)).OrderBy(x => (x.Pos - Pos).LengthSquared()); - if (targets.Count() > 0) - { - SilasHands targetHand = (SilasHands)targets.First(); - targetHand.TakeDamage(); - } - SmokeAfterShoot smokeAfterShoot = new SmokeAfterShoot(new Vector2(Pos.X - 12, Pos.Y + 7)); + StartCicycleAnimation("playerShootBoomUpLeft"); + Bullet bullet = new Bullet(new Vector2(Pos.X, Pos.Y)); + bullet.ShootLeft(); + SmokeAfterShoot smokeAfterShoot = new SmokeAfterShoot(new Vector2(Pos.X - 6, Pos.Y - 7)); } else {