]> git.cameronkatri.com Git - gmtk-gamejam.git/blobdiff - Assets/Scripts/Controllers/Ball.cs
Add non working time shooting
[gmtk-gamejam.git] / Assets / Scripts / Controllers / Ball.cs
index 07e1b37f50fc99c3d5cd70de5cf023ab53826948..936b857e1b83ed4aca69ede6e99699aa6530d760 100644 (file)
@@ -20,11 +20,11 @@ namespace Controllers
       controller.BallDropped();
     }
 
-    public void Shoot(Vector3 target)
+    public void Shoot(Vector3 target, float time)
     {
       transform.right = target - transform.position;
       Rigidbody.velocity = Vector2.zero;
-      Rigidbody.AddForce((transform.right + (transform.up * 0.5f)) * shotForce);
+      Rigidbody.AddForce((transform.right + (transform.up * 0.5f)) * (shotForce * ((Mathf.Clamp(time, 0f, 1f) + 1))));
     }
   }
 }