diff --git a/Assets/Scripts/Generation/DungeonGenerator.cs b/Assets/Scripts/Generation/DungeonGenerator.cs index d7b23fd..f85bdef 100644 --- a/Assets/Scripts/Generation/DungeonGenerator.cs +++ b/Assets/Scripts/Generation/DungeonGenerator.cs @@ -432,7 +432,7 @@ public class DungeonGenerator { r.tiles[pos].type = Room.TileType.ROCK; continue; } - float prob2 = 0.04f; + float prob2 = 0.004f; if (UnityEngine.Random.value > 1 - prob2) { r.spawnpoints.Add(pos); diff --git a/Assets/Scripts/PlayerMovement.cs b/Assets/Scripts/PlayerMovement.cs index 7c6ecfc..7efcabe 100644 --- a/Assets/Scripts/PlayerMovement.cs +++ b/Assets/Scripts/PlayerMovement.cs @@ -15,7 +15,7 @@ public class PlayerMovement : MonoBehaviour { [SerializeField] public float brake = 2f; [SerializeField] - public float maxBrakeTime = 30f; + public float maxBrakeTime = 5f; // The time of the acceleration/deceleration sounds in seconds [SerializeField] @@ -69,12 +69,15 @@ public class PlayerMovement : MonoBehaviour { Vector3 speedVec = new Vector3(rb.velocity.x, rb.velocity.y, 0); float speed = speedVec.magnitude; + maxBrakeTime = 5f; bool braking = Input.GetAxis("Vertical") < 0; - if (brakeTime > maxBrakeTime) { + if (braking && brakeTime >= maxBrakeTime) { brakeTime = maxBrakeTime; braking = false; + } else if (!braking) { + brakeTime -= (Time.time - lastFrame) * 0.1f; } - //Debug.Log(state + " " + braking + " " + (Time.time - changeTime) + " " + accelerationTime); + Debug.Log(braking + " " + brakeTime); if (braking) { brakeTime += Time.time - lastFrame; GameController.instance.GetAudioControl().SfxStop(AudioControl.Sfx.driving); @@ -103,6 +106,8 @@ public class PlayerMovement : MonoBehaviour { break; } } else { + if (brakeTime < 0) + brakeTime = 0; GameController.instance.GetAudioControl().SfxStop(AudioControl.Sfx.slowdriving); switch (state) {