From 8ffc34f2d0a0f5c8dc9fdfc04609a1c633e21eff Mon Sep 17 00:00:00 2001 From: Piegames <14054505+piegamesde@users.noreply.github.com> Date: Mon, 23 Apr 2018 18:21:09 +0200 Subject: [PATCH] Little tweaks --- Assets/Scripts/Generation/DungeonGenerator.cs | 2 +- Assets/Scripts/PlayerMovement.cs | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/Generation/DungeonGenerator.cs b/Assets/Scripts/Generation/DungeonGenerator.cs index 80db011..63ae5b5 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.02f; + float prob2 = 0.04f; if (UnityEngine.Random.value > 1 - prob2) { r.spawnpoints.Add(pos); diff --git a/Assets/Scripts/PlayerMovement.cs b/Assets/Scripts/PlayerMovement.cs index 4989135..605ebb5 100644 --- a/Assets/Scripts/PlayerMovement.cs +++ b/Assets/Scripts/PlayerMovement.cs @@ -57,11 +57,20 @@ public class PlayerMovement : MonoBehaviour { //Debug.Log(br); Debug.DrawLine(transform.position, transform.position + br, Color.red, 0.01f, false); } - if ( Input.GetAxis("Horizontal") < 0 ) - rb.MoveRotation(rb.rotation + turnSpeed); //transform.Rotate(Vector3.forward * turnSpeed); - if ( Input.GetAxis("Horizontal") > 0 ) - rb.MoveRotation(rb.rotation - turnSpeed); + if (Input.GetAxis("Horizontal") < 0) + { + //rb.rotation += turnSpeed; + rb.MoveRotation(rb.rotation + turnSpeed); + } else + //transform.Rotate(Vector3.forward * turnSpeed); + if (Input.GetAxis("Horizontal") > 0) + { + //rb.rotation -= turnSpeed; + rb.MoveRotation(rb.rotation - turnSpeed); + } else { + rb.MoveRotation(rb.rotation); + } //transform.Rotate(Vector3.forward * -turnSpeed); // Debug lines Debug.DrawLine(transform.position, transform.position + speedVec, Color.magenta, 0.01f, false);