Skip to content

Commit

Permalink
fixed changing the controls of the game
Browse files Browse the repository at this point in the history
  • Loading branch information
maxilevi committed Dec 23, 2017
1 parent 966afcc commit e8391fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Assets/Game.unity
Original file line number Diff line number Diff line change
Expand Up @@ -4615,7 +4615,7 @@ MonoBehaviour:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1200556990}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
Expand Down
24 changes: 6 additions & 18 deletions Assets/Movement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,29 +84,17 @@ void Update () {
}

float scale = (Time.timeScale != 1) ? (1 / Time.timeScale) * .5f : 1;
KeyCode UpKey = (Options.Invert) ? KeyCode.W : KeyCode.S;
KeyCode DownKey = (Options.Invert) ? KeyCode.S : KeyCode.W;

if (Input.GetKey(UpKey))
{
transform.localRotation = Quaternion.Euler(transform.localRotation.eulerAngles + Vector3.right * Time.deltaTime * 64f * TurnSpeed * scale);
}

if (Input.GetKey(DownKey))
{
transform.localRotation = Quaternion.Euler(transform.localRotation.eulerAngles - Vector3.right * Time.deltaTime * 64f * TurnSpeed * scale);
}
if(Options.Invert)
transform.localRotation = Quaternion.Euler(transform.localRotation.eulerAngles + Vector3.right * Time.deltaTime * 64f * TurnSpeed * scale * Input.GetAxis("Vertical"));
else
transform.localRotation = Quaternion.Euler(transform.localRotation.eulerAngles + Vector3.right * Time.deltaTime * 64f * TurnSpeed * scale * -Input.GetAxis("Vertical"));

if (Input.GetKey (KeyCode.A)) {
transform.localRotation = Quaternion.Euler(transform.localRotation.eulerAngles + Vector3.forward * Time.deltaTime * 64f * TurnSpeed * scale);
transform.parent.Rotate(- Vector3.up * Time.deltaTime * 64f * TurnSpeed * scale);
}

if (Input.GetKey (KeyCode.D)) {
transform.localRotation = Quaternion.Euler(transform.localRotation.eulerAngles - Vector3.forward * Time.deltaTime * 64f * TurnSpeed * scale);
transform.parent.Rotate( Vector3.up * Time.deltaTime * 64f * TurnSpeed * scale );
transform.localRotation = Quaternion.Euler (transform.localRotation.eulerAngles + Vector3.forward * Time.deltaTime * 64f * TurnSpeed * scale * -Input.GetAxis ("Horizontal"));
transform.parent.Rotate (-Vector3.up * Time.deltaTime * 64f * TurnSpeed * scale * -Input.GetAxis ("Horizontal"));

}
}

void StartTrail(ref TrailRenderer Trail, Vector3 Position){
Expand Down

0 comments on commit e8391fc

Please sign in to comment.