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");
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));
SmokeAfterShoot smokeAfterShoot = new SmokeAfterShoot(new Vector2(Pos.X + 12, Pos.Y));
}
else
{
StartCicycleAnimation("playerShootBoomUpRight");
Bullet bullet = new Bullet(new Vector2(Pos.X + 16, Pos.Y));
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)
@ -212,14 +212,14 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
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));
SmokeAfterShoot smokeAfterShoot = new SmokeAfterShoot(new Vector2(Pos.X - 12, Pos.Y));
}
else
{
StartCicycleAnimation("playerShootBoomUpLeft");
Bullet bullet = new Bullet(new Vector2(Pos.X, Pos.Y));
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");
Vector2 direction;
Vector2 maindirection;
public Vector2 maindirection;
public void ShootUpRight()
{
direction = new Vector2(1, -1);
@ -412,10 +412,6 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
}
public override void Update(GameTime gameTime)
{
if (maindirection != velocity)
{
AppManager.Instance.GameManager.Remove(this);
}
base.Update(gameTime);
}
}

View file

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