Skip to content

Commit

Permalink
Recalibrated gyroscope so that it matched real world locations
Browse files Browse the repository at this point in the history
  • Loading branch information
aworld1 committed Aug 4, 2021
1 parent 7260e4d commit 3151159
Show file tree
Hide file tree
Showing 13 changed files with 113 additions and 3 deletions.
Binary file added Assets/Resources/Audio/Noise/hit1.wav
Binary file not shown.
22 changes: 22 additions & 0 deletions Assets/Resources/Audio/Noise/hit1.wav.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/Resources/Audio/Noise/hit2.wav
Binary file not shown.
22 changes: 22 additions & 0 deletions Assets/Resources/Audio/Noise/hit2.wav.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/Resources/Audio/Noise/hit3.wav
Binary file not shown.
22 changes: 22 additions & 0 deletions Assets/Resources/Audio/Noise/hit3.wav.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/Resources/Audio/Noise/success.mp3
Binary file not shown.
22 changes: 22 additions & 0 deletions Assets/Resources/Audio/Noise/success.mp3.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/Resources/Audio/Reload/ShotgunPump.mp3
Binary file not shown.
22 changes: 22 additions & 0 deletions Assets/Resources/Audio/Reload/ShotgunPump.mp3.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/Scripts/MapHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private void ClearWeapons() {
private void ShowPlayer() {
player.transform.SetParent(map.transform);
playerTransform.anchoredPosition = new Vector2(0, 0);
playerTransform.transform.eulerAngles = Vector3.forward * -Input.compass.trueHeading;
playerTransform.transform.eulerAngles = Vector3.forward * -((Input.compass.trueHeading + 270) % 360);
}

public void SetSelectedWeapon(int num) {
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scripts/ServerHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ public static bool FireWeapon(Dictionary<string, object> weapon) {
hitPlayer = "";
var gyro = (Input.compass.trueHeading + new Random().Next(0, 1000) / 500d
* (int) weapon["inaccuracy"] -
(int) weapon["inaccuracy"] + 360) % 360;
(int) weapon["inaccuracy"] + 540) % 360;
var smallestDistance = (int) weapon["range"] + 1;
foreach (var t in GameHandler.Data.PlayerInfo) {
var pl = (Dictionary<string, object>) t.Value;
if (t.Key == GameHandler.Data.PlayerName || pl["team"].ToString() == GameHandler.Data.Team) continue;
var a = (GPS.AngleBetweenPoints(GPS.Instance.latitude, GPS.Instance.longitude,
Convert.ToDouble(pl["lat"]), Convert.ToDouble(pl["long"])) + 90) % 360;
Convert.ToDouble(pl["lat"]), Convert.ToDouble(pl["long"])) + 360) % 360;
var d = GPS.DistanceBetweenPoints(GPS.Instance.latitude, GPS.Instance.longitude,
Convert.ToDouble(pl["lat"]), Convert.ToDouble(pl["long"]));
var acceptableMiss = MaxMissMargin - Math.Pow(d / (int) weapon["range"], 2) * MaxMissMargin;
Expand Down
Binary file modified Builds/android.apk
Binary file not shown.

0 comments on commit 3151159

Please sign in to comment.