diff options
author | Cameron Katri <me@cameronkatri.com> | 2021-06-12 21:25:59 -0400 |
---|---|---|
committer | Cameron Katri <me@cameronkatri.com> | 2021-06-12 21:25:59 -0400 |
commit | 08c4ba7f5aa07db27341cbd056d6482376191d2a (patch) | |
tree | 583dd59123fac79cf00b4b9d3d334790438d48d4 /Assets/Scripts/Controllers/Ball.cs | |
parent | 1e6b5794b3e0be28192529256d6d3f562f32f4ad (diff) | |
download | gmtk-gamejam-08c4ba7f5aa07db27341cbd056d6482376191d2a.tar.gz gmtk-gamejam-08c4ba7f5aa07db27341cbd056d6482376191d2a.tar.zst gmtk-gamejam-08c4ba7f5aa07db27341cbd056d6482376191d2a.zip |
Add non working time shooting
Diffstat (limited to 'Assets/Scripts/Controllers/Ball.cs')
-rw-r--r-- | Assets/Scripts/Controllers/Ball.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Assets/Scripts/Controllers/Ball.cs b/Assets/Scripts/Controllers/Ball.cs index 07e1b37..936b857 100644 --- a/Assets/Scripts/Controllers/Ball.cs +++ b/Assets/Scripts/Controllers/Ball.cs @@ -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)))); } } } |