feedback addressed

This commit is contained in:
2026-01-30 21:22:59 +05:30
parent 85ef6fb856
commit aedb4f0e96
10 changed files with 166 additions and 48 deletions

View File

@@ -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{