Commit 726003fd authored by astatham's avatar astatham
Browse files

Changed controls to space down for angle, space up for power

parent 4a1d620a
......@@ -15,26 +15,26 @@ public class Needle : MonoBehaviour {
gameObject.transform.rotation = Quaternion.Euler(0, 0, currentAngle);
previousAngle = currentAngle;
currentAngle += (angleChangeSpeed * Time.deltaTime);
} else if (currentAngle <= maxAngle && currentAngle > minAngle && currentAngle < previousAngle)
} else if (currentAngle <= maxAngle && currentAngle > minAngle && currentAngle < previousAngle)
{
gameObject.transform.rotation = Quaternion.Euler(0, 0, currentAngle);
previousAngle = currentAngle;
currentAngle -= (angleChangeSpeed * Time.deltaTime);
} else if (currentAngle > previousAngle)
} else if (currentAngle > previousAngle)
{
gameObject.transform.rotation = Quaternion.Euler(0, 0, currentAngle);
previousAngle = currentAngle;
currentAngle -= (angleChangeSpeed * Time.deltaTime);
} else if (currentAngle < previousAngle)
} else if (currentAngle < previousAngle)
{
gameObject.transform.rotation = Quaternion.Euler(0, 0, currentAngle);
previousAngle = currentAngle;
currentAngle += (angleChangeSpeed * Time.deltaTime);
}
if (Input.GetButton("Jump")){
if (Input.GetKeyDown("space")){
finalAngle = currentAngle;
previousAngle = currentAngle;
PowerBar.previousPos = -9f;
......
......@@ -2,8 +2,8 @@
using System.Collections.Generic;
using UnityEngine;
public class PowerBar : MonoBehaviour {
public class PowerBar : MonoBehaviour {
public float posChangeSpeed, maxPos, minPos;
public Transform piePrefab;
float currentPos = -8f;
......@@ -39,7 +39,7 @@ public class PowerBar : MonoBehaviour {
currentPos += (posChangeSpeed * Time.deltaTime);
}
if (Input.GetKey("left shift"))
if (Input.GetKeyUp("space"))
{
finalPos = currentPos;
previousPos = currentPos;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment