diff --git a/.vs/EvilSatellites/DesignTimeBuild/.dtbcache.v2 b/.vs/EvilSatellites/DesignTimeBuild/.dtbcache.v2 index 8058be7..6e23536 100644 Binary files a/.vs/EvilSatellites/DesignTimeBuild/.dtbcache.v2 and b/.vs/EvilSatellites/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/EvilSatellites/v16/.suo b/.vs/EvilSatellites/v16/.suo index 576920a..53a0092 100644 Binary files a/.vs/EvilSatellites/v16/.suo and b/.vs/EvilSatellites/v16/.suo differ diff --git a/EvilSatellites/EvilSatellites.csproj b/EvilSatellites/EvilSatellites.csproj index 902b24d..8b434b1 100644 --- a/EvilSatellites/EvilSatellites.csproj +++ b/EvilSatellites/EvilSatellites.csproj @@ -10,7 +10,7 @@ Icon.ico - d:\EvilSatellites\ + diff --git a/EvilSatellites/GameSettings.cs b/EvilSatellites/GameSettings.cs index ccfc17a..adf9f09 100644 --- a/EvilSatellites/GameSettings.cs +++ b/EvilSatellites/GameSettings.cs @@ -9,6 +9,6 @@ namespace EvilSatellites public static class GameSettings { public static bool PreferSAPI = true; - + public static bool UseForceFeedback = true; } } diff --git a/EvilSatellites/GameStats.cs b/EvilSatellites/GameStats.cs index 8bbe365..ae6182b 100644 --- a/EvilSatellites/GameStats.cs +++ b/EvilSatellites/GameStats.cs @@ -13,6 +13,7 @@ namespace EvilSatellites public static int DebrisCollected; public static int SatelliteCollisions; public static int DebrisCollisions; + public static int Wave; public static double TotalPlayTime; public static void Reset() { @@ -22,7 +23,7 @@ namespace EvilSatellites SatelliteCollisions = 0; DebrisCollisions = 0; TotalPlayTime = 0; - + Wave = 1; } } } diff --git a/EvilSatellites/Radar.cs b/EvilSatellites/Radar.cs index d1ae6d3..e7e870e 100644 --- a/EvilSatellites/Radar.cs +++ b/EvilSatellites/Radar.cs @@ -23,6 +23,7 @@ namespace EvilSatellites public bool IsPlaying; public Vector3 RadarTarget; public Matrix RadarOrientation; + public Radar(IGameObject owner, IScreen screen) { Owner = owner; @@ -91,7 +92,10 @@ namespace EvilSatellites } } else { - if (objects.Count < 1) return; + if (objects.Count < 1) + { + RadarNoise.Volume = 0f; + } float minDistance = 50000000; Target = null; foreach (var obj in objects) @@ -106,7 +110,7 @@ namespace EvilSatellites } if (Target == null) { - // RadarNoise.Pitch = 0.1; + RadarNoise.Volume = 0f; return; } Vector3 radarTarget = (Target.Position - Owner.Position); @@ -116,6 +120,7 @@ namespace EvilSatellites 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.Volume = 1f; // RadarNoise.Play(); IsPlaying = true; // RadarNoise.Pitch = MathHelper.Clamp(0.1f / Vector3.Distance(Owner.Rotation.Forward, radarTarget) * 3f, 0, 1); diff --git a/EvilSatellites/SatelliteSpawner.cs b/EvilSatellites/SatelliteSpawner.cs index bdeacc9..031986a 100644 --- a/EvilSatellites/SatelliteSpawner.cs +++ b/EvilSatellites/SatelliteSpawner.cs @@ -14,6 +14,8 @@ namespace EvilSatellites public GameScreen Screen; private Random rnd = new Random(); private int Level; + private double RespawnTimer; + private bool IsRespawning; public SatelliteSpawner(GameScreen screen) { Screen = screen; @@ -32,15 +34,28 @@ namespace EvilSatellites var sat = new Satellite(Screen, new Vector3(x, y, z)); Screen.AddObject(sat); } + Screen.Manager.Sound.PlayOneshot(@"sfx/ui/enemiesDetected.wav"); + IsRespawning = false; } - public void Update() + public void Update(GameTime time) { var sats = Screen.Objects.Where((x) => x.Type == ObjectType.Satellite).ToList(); - if (sats.Count < 1) + if (sats.Count < 1 && IsRespawning == false) { - Level++; - Spawn(); + IsRespawning = true; + RespawnTimer = 0; + } + if (IsRespawning) + { + RespawnTimer += time.ElapsedGameTime.TotalMilliseconds; + if (RespawnTimer > 5000) + { + GameStats.Wave++; + Level++; + Spawn(); + } + } } diff --git a/EvilSatellites/Screens/GameScreen.cs b/EvilSatellites/Screens/GameScreen.cs index 8657103..c4ba770 100644 --- a/EvilSatellites/Screens/GameScreen.cs +++ b/EvilSatellites/Screens/GameScreen.cs @@ -91,7 +91,7 @@ namespace EvilSatellites.Screens } UpdateRadar(); CheckCollisions(); - Spawner.Update(); + Spawner.Update(gameTime); return; } diff --git a/EvilSatellites/Screens/OptionsScreen.cs b/EvilSatellites/Screens/OptionsScreen.cs index 2873912..3586d14 100644 --- a/EvilSatellites/Screens/OptionsScreen.cs +++ b/EvilSatellites/Screens/OptionsScreen.cs @@ -15,6 +15,7 @@ namespace EvilSatellites.Screens MenuOptions = new MenuContainer("Options", "Set global options for the game."); MenuOptions.Add(new MenuEntry("Music Volume", "Toggle between music volumes")) .Add(new MenuEntry("Use screen reader", "Use screen reader speech instead of SAPI")) + .Add(new MenuEntry("Use Force Feedback", "Vibrate on certain game actions such as weapon fire, getting hit, etc.")) .Add(new MenuEntry("Back", "Go Back to previous screen")); base.Activate(); } @@ -31,6 +32,10 @@ namespace EvilSatellites.Screens ChangeSpeech(); } if (CursorPosition == 2) + { + ChangeForceFeedback(); + } + if (CursorPosition == 3) { Manager.RemoveScreen(this); Manager.AddScreen(new MainMenuScreen()); @@ -73,5 +78,20 @@ namespace EvilSatellites.Screens } } + + public void ChangeForceFeedback() + { + if (GameSettings.UseForceFeedback) + { + GameSettings.UseForceFeedback = false; + Tolk.Output("Disabled force feedback"); + } + else + { + GameSettings.UseForceFeedback = true; + Tolk.Output("Enabled force feedback"); + Manager.Vibrations.AddVibration(1, 1, 500); + } + } } } diff --git a/EvilSatellites/Screens/StatsScreen.cs b/EvilSatellites/Screens/StatsScreen.cs index 57c4fde..fc7caf6 100644 --- a/EvilSatellites/Screens/StatsScreen.cs +++ b/EvilSatellites/Screens/StatsScreen.cs @@ -17,6 +17,7 @@ namespace EvilSatellites.Screens .Add(new MenuEntry("Satellites shot: " + GameStats.SatellitesShot.ToString(), "Amount of satellites shot during this game.")) .Add(new MenuEntry("Debris collected: " + GameStats.DebrisCollected.ToString(), "Amount of debris collected during this game.")) .Add(new MenuEntry("Satellite collisions: " + GameStats.SatelliteCollisions.ToString(), "How many satellites you crashed into")) + .Add(new MenuEntry("Wave: " + GameStats.Wave.ToString(), "The wave you died on.")) .Add(new MenuEntry("Total play time: " + TimeSpan.FromSeconds(GameStats.TotalPlayTime).ToString(), "How much time you spent on this run")) .Add(new MenuEntry("OK", "Go back to main menu")); base.Activate(); diff --git a/EvilSatellites/VibrationManager.cs b/EvilSatellites/VibrationManager.cs index 27dc99b..abab682 100644 --- a/EvilSatellites/VibrationManager.cs +++ b/EvilSatellites/VibrationManager.cs @@ -20,11 +20,16 @@ namespace EvilSatellites public void AddVibration(float leftMotor, float rightMotor, float durationMS) { - vibrations.Add(new Vibration(leftMotor, rightMotor, durationMS)); + if (GameSettings.UseForceFeedback) + { + vibrations.Add(new Vibration(leftMotor, rightMotor, durationMS)); + } + } public void Update(float msElapsed) { + if (!GameSettings.UseForceFeedback) return; List toDelete = new List(); foreach (Vibration vibration in vibrations) diff --git a/EvilSatellites/Weapons/LaserMG.cs b/EvilSatellites/Weapons/LaserMG.cs index 55e787c..a5403f6 100644 --- a/EvilSatellites/Weapons/LaserMG.cs +++ b/EvilSatellites/Weapons/LaserMG.cs @@ -90,7 +90,7 @@ namespace EvilSatellites.Weapons if (RemainingAmmo > 0) { sfxShoot.Play(); - Screen.Manager.Vibrations.AddVibration(1, 1, 100); + Screen.Manager.Vibrations.AddVibration(1, 1, 70); RemainingAmmo--; TimerStart = TimerEnd; Projectile proj = new Projectile(Screen, _wielder.Position, _wielder.Rotation, _wielder); diff --git a/EvilSatellites/sfx/music/game1.mp3 b/EvilSatellites/sfx/music/game1.mp3 index b339ab4..8347321 100644 Binary files a/EvilSatellites/sfx/music/game1.mp3 and b/EvilSatellites/sfx/music/game1.mp3 differ diff --git a/EvilSatellites/sfx/music/game1.mp3.mrk b/EvilSatellites/sfx/music/game1.mp3.mrk new file mode 100644 index 0000000..2db6c32 Binary files /dev/null and b/EvilSatellites/sfx/music/game1.mp3.mrk differ diff --git a/EvilSatellites/sfx/music/menu1.mp3 b/EvilSatellites/sfx/music/menu1.mp3 index 1005ccb..25cd4aa 100644 Binary files a/EvilSatellites/sfx/music/menu1.mp3 and b/EvilSatellites/sfx/music/menu1.mp3 differ diff --git a/EvilSatellites/sfx/music/menu1.mp3.mrk b/EvilSatellites/sfx/music/menu1.mp3.mrk new file mode 100644 index 0000000..631e733 Binary files /dev/null and b/EvilSatellites/sfx/music/menu1.mp3.mrk differ diff --git a/EvilSatellites/sfx/ui/EnemiesDetected.wav b/EvilSatellites/sfx/ui/EnemiesDetected.wav new file mode 100644 index 0000000..c285b32 --- /dev/null +++ b/EvilSatellites/sfx/ui/EnemiesDetected.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b793fb1ac73870eea5242d89e85373359b8ce13cec7f541affaad2c53f71046 +size 126764 diff --git a/EvilSatellites/sfx/weapons/LaserMG/reload.wav b/EvilSatellites/sfx/weapons/LaserMG/reload.wav index b63da5f..e5c3713 100644 --- a/EvilSatellites/sfx/weapons/LaserMG/reload.wav +++ b/EvilSatellites/sfx/weapons/LaserMG/reload.wav @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f7e1fcdc804e2ea60f61554ee6147d54f87a5da5da21b232f4c5142413e4ff5d -size 332210 +oid sha256:4f94a1e2d76335c9f6a741f8713d6c9be832705c231a23775c6e4292a70b596e +size 311668