public void Shoot() { if (timeSinceLastShot >= timeForSingleShot) { Pistol.Shoot(level, Position, level.GetPlayerCoordinates(), this); //level.Map.Bullets.Add(new Bullet(Position, level.GetPlayerCoordinates(), level, this)); timeSinceLastShot = 0f; } }
public void Shoot() { if (Mouse.IsButtonPressed(Mouse.Button.Left) && timeSinceLastShot >= timeForSingleShot) { if (weapon == Weapons.Pistol) { Pistol.Shoot(level, Position, sight.Position, this); } if (weapon == Weapons.Shotgun) { Shotgun.Shoot(level, Position, sight.Position, this); } timeSinceLastShot = 0f; } }