mp fundementals and turn timer
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user