mp fundementals and turn timer

This commit is contained in:
2026-02-14 18:18:45 +05:30
parent 614c38bdaf
commit 02dee0b86d
64 changed files with 7472 additions and 82 deletions
+5 -5
View File
@@ -40,7 +40,7 @@ public class Ball : MonoBehaviour
float otherSpeed = collision.relativeVelocity.magnitude;
float velocityMult = 1- Mathf.Clamp01(rb.linearVelocity.magnitude / maxWallStuckVelocity);
Debug.Log($"{collision.collider.name} hit ball @ {otherSpeed}, ball speed: {rb.linearVelocity.magnitude}");
// Debug.Log($"{collision.collider.name} hit ball @ {otherSpeed}, ball speed: {rb.linearVelocity.magnitude}");
int mult=0;
if(touchingB){
mult++;
@@ -56,16 +56,16 @@ public class Ball : MonoBehaviour
}
velocityMult *= mult;
if (touchingR) {
rb.AddForce(Vector2.left * otherSpeed *wallStuckFixForce * velocityMult * Time.deltaTime);
rb.AddForce(Vector2.left * otherSpeed *wallStuckFixForce * velocityMult );
}
if (touchingL) {
rb.AddForce(Vector2.right * otherSpeed * wallStuckFixForce * velocityMult * Time.deltaTime);
rb.AddForce(Vector2.right * otherSpeed * wallStuckFixForce * velocityMult );
}
if (touchingT) {
rb.AddForce(Vector2.down * otherSpeed * wallStuckFixForce * velocityMult * Time.deltaTime);
rb.AddForce(Vector2.down * otherSpeed * wallStuckFixForce * velocityMult );
}
if (touchingB) {
rb.AddForce(Vector2.up *otherSpeed * wallStuckFixForce * velocityMult * Time.deltaTime);
rb.AddForce(Vector2.up *otherSpeed * wallStuckFixForce * velocityMult );
}
}