diff --git a/.vs/EvilSatellites/v16/.suo b/.vs/EvilSatellites/v16/.suo index 9634a6a..80e1eab 100644 Binary files a/.vs/EvilSatellites/v16/.suo and b/.vs/EvilSatellites/v16/.suo differ diff --git a/EvilSatellites/Objects/Debris.cs b/EvilSatellites/Objects/Debris.cs index 2b227e2..5b4deb3 100644 --- a/EvilSatellites/Objects/Debris.cs +++ b/EvilSatellites/Objects/Debris.cs @@ -56,7 +56,7 @@ namespace EvilSatellites.Objects var player = (Player)obj; if (player.Vacuuming) { - player.CurrentWeapon.Reload(rnd.Next(player.CurrentWeapon.MaxAmmo)); + player.CurrentWeapon.Reload(rnd.Next(player.CurrentWeapon.MaxAmmo/4)); Destroy(); return; } diff --git a/EvilSatellites/Objects/Satellite.cs b/EvilSatellites/Objects/Satellite.cs index 1c77cf0..96df7da 100644 --- a/EvilSatellites/Objects/Satellite.cs +++ b/EvilSatellites/Objects/Satellite.cs @@ -88,8 +88,12 @@ namespace EvilSatellites.Objects public void SpawnDebris() { - var screen = (GameScreen)Screen; - screen.AddObject(new Debris(screen, Position)); + var amount = rnd.Next(3) + 1; + for (var i = 0; i < amount; i++) + { + var screen = (GameScreen)Screen; + screen.AddObject(new Debris(screen, Position)); + } } } } diff --git a/EvilSatellites/Radar.cs b/EvilSatellites/Radar.cs index 8f87568..31332bb 100644 --- a/EvilSatellites/Radar.cs +++ b/EvilSatellites/Radar.cs @@ -22,6 +22,7 @@ namespace EvilSatellites public Vector3 RadarPosition; public bool IsPlaying; public Vector3 RadarTarget; + public Matrix RadarOrientation; public Radar(IGameObject owner, IScreen screen) { Owner = owner; @@ -113,7 +114,7 @@ namespace EvilSatellites RadarTarget = radarTarget; RadarPosition = new Vector3(Owner.Position.X+Owner.Dimensions.X/2, Owner.Position.Y+Owner.Dimensions.Y/2, Owner.Position.Z+Owner.Dimensions.Z/2); RadarDirection = new Vector3(radarTarget.X*0.5f, radarTarget.Y*0.5f, radarTarget.Z*0.5f); - + RadarOrientation = Matrix.Invert(Matrix.CreateTranslation(Target.Position) * Matrix.CreateLookAt(Target.Position, Owner.Position, Owner.Rotation.Up)); RadarNoise.Reset(); // RadarNoise.Play(); IsPlaying = true; diff --git a/EvilSatellites/Screens/GameScreen.cs b/EvilSatellites/Screens/GameScreen.cs index a392c93..11d2ba7 100644 --- a/EvilSatellites/Screens/GameScreen.cs +++ b/EvilSatellites/Screens/GameScreen.cs @@ -183,7 +183,7 @@ namespace EvilSatellites.Screens if (Input.IsJustPressed(Keys.H)) { _player.PlayTap(); - Tolk.Output(_player.Health.ToString() + " health", true); + Tolk.Output(Math.Round(_player.Health).ToString() + " health", true); } if (Input.IsJustPressed(Keys.X)) { @@ -193,7 +193,17 @@ namespace EvilSatellites.Screens if (Input.IsJustPressed(Keys.Y)) { _player.PlayTap(); - if (ObjectRadar.Target != null) Tolk.Output(Vector3.Distance(_player.Position, ObjectRadar.Target.Position).ToString() + " units", true); + if (ObjectRadar.Target != null) + { + Tolk.Output(Math.Round(Vector3.Distance(_player.Position, ObjectRadar.Target.Position)).ToString() + " units", true); + var radarYaw = (float)System.Math.Atan2(ObjectRadar.RadarOrientation.M13, ObjectRadar.RadarOrientation.M33); + var radarPitch = (float)System.Math.Asin(-ObjectRadar.RadarOrientation.M23); + var playerYaw = (float)System.Math.Atan2(_player.Rotation.M13, _player.Rotation.M33); + var playerPitch = (float)System.Math.Asin(-_player.Rotation.M23); + var totalYaw = MathHelper.ToDegrees(MathHelper.WrapAngle(radarYaw - playerYaw + MathHelper.Pi)); + var totalPitch = MathHelper.ToDegrees(MathHelper.WrapAngle(radarPitch - playerPitch)); + Tolk.Output(Math.Round(totalYaw).ToString() + " horizontal, " + Math.Round(totalPitch).ToString() + " vertical"); + } } if (Input.IsJustPressed(Keys.O)) {