This commit is contained in:
AnloGames 2023-08-18 20:08:16 +03:00
parent 87c3a168af
commit 0a6e6573c5
2 changed files with 6 additions and 9 deletions

View file

@ -195,14 +195,14 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
StartCicycleAnimation("playerShootRight"); StartCicycleAnimation("playerShootRight");
Bullet bullet = new Bullet(new Vector2(Pos.X + 16, Pos.Y)); Bullet bullet = new Bullet(new Vector2(Pos.X + 16, Pos.Y));
bullet.ShootRight(); bullet.ShootRight();
SmokeAfterShoot smokeAfterShoot = new SmokeAfterShoot(new Vector2(Pos.X + 12, Pos.Y - 8)); SmokeAfterShoot smokeAfterShoot = new SmokeAfterShoot(new Vector2(Pos.X + 12, Pos.Y));
} }
else else
{ {
StartCicycleAnimation("playerShootBoomUpRight"); StartCicycleAnimation("playerShootBoomUpRight");
Bullet bullet = new Bullet(new Vector2(Pos.X + 16, Pos.Y)); Bullet bullet = new Bullet(new Vector2(Pos.X + 16, Pos.Y));
bullet.ShootUpRight(); bullet.ShootUpRight();
SmokeAfterShoot smokeAfterShoot = new SmokeAfterShoot(new Vector2(Pos.X + 12, Pos.Y - 8)); SmokeAfterShoot smokeAfterShoot = new SmokeAfterShoot(new Vector2(Pos.X + 12, Pos.Y));
} }
} }
else if(!isRight) else if(!isRight)
@ -212,14 +212,14 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
StartCicycleAnimation("playerShootBoomUpLeft"); StartCicycleAnimation("playerShootBoomUpLeft");
Bullet bullet = new Bullet(new Vector2(Pos.X, Pos.Y)); Bullet bullet = new Bullet(new Vector2(Pos.X, Pos.Y));
bullet.ShootLeft(); bullet.ShootLeft();
SmokeAfterShoot smokeAfterShoot = new SmokeAfterShoot(new Vector2(Pos.X - 6, Pos.Y - 7)); SmokeAfterShoot smokeAfterShoot = new SmokeAfterShoot(new Vector2(Pos.X - 12, Pos.Y));
} }
else else
{ {
StartCicycleAnimation("playerShootBoomUpLeft"); StartCicycleAnimation("playerShootBoomUpLeft");
Bullet bullet = new Bullet(new Vector2(Pos.X, Pos.Y)); Bullet bullet = new Bullet(new Vector2(Pos.X, Pos.Y));
bullet.ShootUpLeft(); bullet.ShootUpLeft();
SmokeAfterShoot smokeAfterShoot = new SmokeAfterShoot(new Vector2(Pos.X - 6, Pos.Y - 7)); SmokeAfterShoot smokeAfterShoot = new SmokeAfterShoot(new Vector2(Pos.X - 6, Pos.Y));
} }
} }
} }
@ -344,7 +344,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
} }
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "playerMoveLeft" }, "playerMoveLeft"); protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "playerMoveLeft" }, "playerMoveLeft");
Vector2 direction; Vector2 direction;
Vector2 maindirection; public Vector2 maindirection;
public void ShootUpRight() public void ShootUpRight()
{ {
direction = new Vector2(1, -1); direction = new Vector2(1, -1);
@ -412,10 +412,6 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
} }
public override void Update(GameTime gameTime) public override void Update(GameTime gameTime)
{ {
if (maindirection != velocity)
{
AppManager.Instance.GameManager.Remove(this);
}
base.Update(gameTime); base.Update(gameTime);
} }
} }

View file

@ -241,6 +241,7 @@ namespace DangerousD.GameCore
Player.Bullet bullet = new Player.Bullet(networkTask.position); Player.Bullet bullet = new Player.Bullet(networkTask.position);
bullet.id = networkTask.objId; bullet.id = networkTask.objId;
bullet.velocity = networkTask.velocity; bullet.velocity = networkTask.velocity;
bullet.maindirection = bullet.velocity;
} }
break; break;
case NetworkTaskOperationEnum.SendPosition: case NetworkTaskOperationEnum.SendPosition: