feedback addressed
This commit is contained in:
@@ -23,7 +23,9 @@ public class GameManager : MonoBehaviour
|
||||
}
|
||||
public EventTrigger gameInputPanel;
|
||||
public Rigidbody2D ball;
|
||||
public float puckForce = 1f;
|
||||
public float puckForce = 20f;
|
||||
[Range(0f,1f)]
|
||||
public float puckForceMaxPoint = 0.75f;
|
||||
public float ballMoveTime = 3f;
|
||||
public float puckDragClamp = 5f;
|
||||
|
||||
@@ -114,13 +116,16 @@ public class GameManager : MonoBehaviour
|
||||
Debug.Log("Pointer up");
|
||||
PointerEventData pointerEventData = eventData as PointerEventData;
|
||||
Vector2 endPosition = pointerEventData.position;
|
||||
Vector2 direction = endPosition - startPosition;
|
||||
// Vector2 direction = endPosition - startPosition;
|
||||
Vector2 direction = selectedPuck.lineEnd;
|
||||
if(coroutinePostLaunch != null){
|
||||
StopCoroutine(coroutinePostLaunch);
|
||||
}
|
||||
coroutinePostLaunch = StartCoroutine(CoroutinePostLaunch());
|
||||
|
||||
selectedPuck.GetComponent<Rigidbody2D>().AddForce(-direction * puckForce * Time.deltaTime, ForceMode2D.Impulse);
|
||||
float force = puckForce * Time.deltaTime;
|
||||
Debug.Log($"launching puck at {direction}");
|
||||
selectedPuck.GetComponent<Rigidbody2D>().AddForce(-direction * force, ForceMode2D.Impulse);
|
||||
|
||||
startPosition = Vector2.zero;
|
||||
selectedPuck = null;
|
||||
@@ -169,7 +174,7 @@ public class GameManager : MonoBehaviour
|
||||
public void OnGoal(Team team){
|
||||
freezeInput=true;
|
||||
|
||||
if(team == SelectedTeam){
|
||||
if(team == Team.Blue){
|
||||
blueScore++;
|
||||
blueScoreText.text = blueScore.ToString();
|
||||
}else{
|
||||
|
||||
Reference in New Issue
Block a user